Firefox pinned tab workaround, closes #356
This commit is contained in:
@@ -360,11 +360,23 @@ class EditorCtrl extends PureCtrl {
|
||||
return this.actionsManager.extensionsInContextOfItem(this.state.note).length > 0;
|
||||
}
|
||||
|
||||
performFirefoxPinnedTabFix() {
|
||||
/**
|
||||
* For Firefox pinned tab issue:
|
||||
* When a new browser session is started, and SN is in a pinned tab,
|
||||
* SN is unusable until the tab is reloaded.
|
||||
*/
|
||||
if (document.hidden) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
saveNote({
|
||||
bypassDebouncer,
|
||||
updateClientModified,
|
||||
dontUpdatePreviews
|
||||
}) {
|
||||
this.performFirefoxPinnedTabFix();
|
||||
const note = this.state.note;
|
||||
note.dummy = false;
|
||||
if (note.deleted) {
|
||||
@@ -545,7 +557,7 @@ class EditorCtrl extends PureCtrl {
|
||||
const text = StringDeleteNote({
|
||||
title: title,
|
||||
permanently: permanently
|
||||
})
|
||||
});
|
||||
this.alertManager.confirm({
|
||||
text: text,
|
||||
destructive: true,
|
||||
@@ -899,7 +911,7 @@ class EditorCtrl extends PureCtrl {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this.state.note) {
|
||||
else if (this.state.note) {
|
||||
const enableable = (
|
||||
component.isExplicitlyEnabledForItem(this.state.note)
|
||||
|| component.isDefaultEditor()
|
||||
@@ -1138,12 +1150,12 @@ class EditorCtrl extends PureCtrl {
|
||||
note.text = editor.value;
|
||||
this.setState({
|
||||
note: note
|
||||
})
|
||||
});
|
||||
this.saveNote({
|
||||
bypassDebouncer: true
|
||||
});
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Handles when the editor is destroyed,
|
||||
|
||||
13
dist/javascripts/app.js
vendored
13
dist/javascripts/app.js
vendored
@@ -741,6 +741,18 @@ function (_PureCtrl) {
|
||||
value: function hasAvailableExtensions() {
|
||||
return this.actionsManager.extensionsInContextOfItem(this.state.note).length > 0;
|
||||
}
|
||||
}, {
|
||||
key: "performFirefoxPinnedTabFix",
|
||||
value: function performFirefoxPinnedTabFix() {
|
||||
/**
|
||||
* For Firefox pinned tab issue:
|
||||
* When a new browser session is started, and SN is in a pinned tab,
|
||||
* SN is unusable until the tab is reloaded.
|
||||
*/
|
||||
if (document.hidden) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "saveNote",
|
||||
value: function saveNote(_ref2) {
|
||||
@@ -749,6 +761,7 @@ function (_PureCtrl) {
|
||||
var bypassDebouncer = _ref2.bypassDebouncer,
|
||||
updateClientModified = _ref2.updateClientModified,
|
||||
dontUpdatePreviews = _ref2.dontUpdatePreviews;
|
||||
this.performFirefoxPinnedTabFix();
|
||||
var note = this.state.note;
|
||||
note.dummy = false;
|
||||
|
||||
|
||||
2
dist/javascripts/app.js.map
vendored
2
dist/javascripts/app.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user