chore: correctly close modals and show toast after creating note from shared text

This commit is contained in:
Aman Harwara
2023-07-13 02:16:54 +05:30
parent 8294d0663f
commit 512b8d9fbc
7 changed files with 50 additions and 9 deletions

View File

@@ -56,6 +56,7 @@ import { ItemGroupController } from '@/Components/NoteView/Controller/ItemGroupC
import { VisibilityObserver } from './VisibilityObserver'
import { MomentsService } from '@/Controllers/Moments/MomentsService'
import { DevMode } from './DevMode'
import { ToastType, addToast } from '@standardnotes/toast'
export type WebEventObserver = (event: WebAppEvent, data?: unknown) => void
@@ -411,6 +412,11 @@ export class WebApplication extends SNApplication implements WebApplicationInter
const insertedNote = await this.mutator.insertItem(note)
this.controllers.selectionController.selectItem(insertedNote.uuid, true).catch(console.error)
addToast({
type: ToastType.Success,
message: 'Successfully created note from shared text',
})
}
private async lockApplicationAfterMobileEventIfApplicable(): Promise<void> {