fix: select first note on sign in
This commit is contained in:
@@ -29,7 +29,6 @@ type NotesState = {
|
||||
panelTitle: string
|
||||
notes?: SNNote[]
|
||||
renderedNotes?: SNNote[]
|
||||
activeEditor: Editor
|
||||
sortBy?: string
|
||||
sortReverse?: boolean
|
||||
showArchived?: boolean
|
||||
@@ -79,11 +78,6 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
this.panelPuppet = {
|
||||
onReady: () => this.reloadPanelWidth()
|
||||
};
|
||||
this.unsubEditorChange = this.application.editorGroup.addChangeObserver(() => {
|
||||
this.setNotesState({
|
||||
activeEditor: this.application.editorGroup.activeEditor
|
||||
});
|
||||
})
|
||||
this.onWindowResize = this.onWindowResize.bind(this);
|
||||
this.onPanelResize = this.onPanelResize.bind(this);
|
||||
window.addEventListener('resize', this.onWindowResize, true);
|
||||
@@ -97,8 +91,6 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
deinit() {
|
||||
this.panelPuppet!.onReady = undefined;
|
||||
this.panelPuppet = undefined;
|
||||
this.unsubEditorChange();
|
||||
this.unsubEditorChange = undefined;
|
||||
window.removeEventListener('resize', this.onWindowResize, true);
|
||||
(this.onWindowResize as any) = undefined;
|
||||
(this.onPanelResize as any) = undefined;
|
||||
@@ -153,7 +145,7 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
|
||||
/** @template */
|
||||
public get activeEditorNote() {
|
||||
return this.getState().activeEditor?.note;
|
||||
return this.appState.getActiveEditor()?.note;
|
||||
}
|
||||
|
||||
public get editorNotes() {
|
||||
@@ -164,6 +156,7 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
async onAppEvent(eventName: ApplicationEvent) {
|
||||
if (eventName === ApplicationEvent.SignedIn) {
|
||||
this.appState.closeAllEditors();
|
||||
this.selectFirstNote();
|
||||
} else if (eventName === ApplicationEvent.CompletedSync) {
|
||||
this.getMostValidNotes().then((notes) => {
|
||||
if (notes.length === 0) {
|
||||
|
||||
@@ -123,14 +123,14 @@
|
||||
)
|
||||
p.sk-p Stay signed in
|
||||
label.sk-panel-row.justify-left(ng-if='self.notesAndTagsCount() > 0')
|
||||
.sk-panel-row
|
||||
input(
|
||||
ng-bind='true',
|
||||
ng-change='self.mergeLocalChanged()',
|
||||
ng-model='self.state.formData.mergeLocal',
|
||||
type='checkbox'
|
||||
)
|
||||
| Merge local data ({{self.notesAndTagsCount()}} notes and tags)
|
||||
.sk-horizontal-group.tight
|
||||
input(
|
||||
ng-bind='true',
|
||||
ng-change='self.mergeLocalChanged()',
|
||||
ng-model='self.state.formData.mergeLocal',
|
||||
type='checkbox'
|
||||
)
|
||||
p.sk-p Merge local data ({{self.notesAndTagsCount()}} notes and tags)
|
||||
.sk-panel-section(ng-if='self.state.formData.mfa')
|
||||
form.sk-panel-form(ng-submit='self.submitMfaForm()')
|
||||
.sk-p.sk-panel-row {{self.state.formData.mfa.message}}
|
||||
|
||||
14
dist/javascripts/app.js
vendored
14
dist/javascripts/app.js
vendored
File diff suppressed because one or more lines are too long
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