mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 01:06:36 +01:00
chore(frontend-docs): fix warnings & update
This commit is contained in:
@@ -76,6 +76,11 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the widget is enabled. Widgets are enabled by default. Generally setting this to `false` will cause the widget not to be displayed, however it will still be available on the DOM but hidden.
|
||||
*
|
||||
* <p>
|
||||
* If the widget is not enabled, it will not receive `refreshWithNote` updates.
|
||||
*
|
||||
* @returns {boolean} true when an active note exists
|
||||
*/
|
||||
isEnabled() {
|
||||
@@ -85,7 +90,17 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
async refresh() {
|
||||
if (this.isEnabled()) {
|
||||
this.toggleInt(true);
|
||||
await this.refreshWithNote(this.note);
|
||||
|
||||
try {
|
||||
await this.refreshWithNote(this.note);
|
||||
} catch (e) {
|
||||
// Ignore errors when user is refreshing or navigating away.
|
||||
if (e === "rejected by browser") {
|
||||
return;
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toggleInt(false);
|
||||
@@ -164,7 +179,7 @@ export default NoteContextAwareWidget;
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
Reference in New Issue
Block a user