fixes below:

Make text selectable in log dialog.
Dumping errors when couldn't connect
Invalid uri could not detected.
Add tooltips to statusbar
This commit is contained in:
vorotamoroz
2021-11-08 17:52:07 +09:00
parent d324f08240
commit 53b4d4cd20
5 changed files with 8 additions and 5 deletions

View File

@@ -231,7 +231,7 @@ const isValidRemoteCouchDBURI = (uri: string): boolean => {
return false;
};
const connectRemoteCouchDB = async (uri: string, auth: { username: string; password: string }): Promise<false | { db: PouchDB.Database; info: any }> => {
if (!isValidRemoteCouchDBURI(uri)) false;
if (!isValidRemoteCouchDBURI(uri)) return false;
let db = new PouchDB(uri, {
auth,
});
@@ -239,6 +239,7 @@ const connectRemoteCouchDB = async (uri: string, auth: { username: string; passw
let info = await db.info();
return { db: db, info: info };
} catch (ex) {
Logger(ex, LOG_LEVEL.VERBOSE);
return false;
}
};
@@ -1683,6 +1684,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
default:
w = "?";
}
this.statusBar.title = this.localDatabase.syncStatus;
this.statusBar.setText(`Sync:${w}${sent}${arrived}`);
}
async replicate(showMessage?: boolean) {