From a101337213f44ae6e016cfa775962d679290250b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Tue, 10 Oct 2023 15:49:36 +0200 Subject: [PATCH] (core) Disabling unsaved changes when logging in Summary: Disabling unsaved changes when user tries to login or singup as those endpoints tries to redirect back to the unsaved fork. Test Plan: Added new test Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D4071 --- app/client/ui/AccountWidget.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/client/ui/AccountWidget.ts b/app/client/ui/AccountWidget.ts index f221c87b..86150d61 100644 --- a/app/client/ui/AccountWidget.ts +++ b/app/client/ui/AccountWidget.ts @@ -60,6 +60,7 @@ export class AccountWidget extends Disposable { return [ cssSigninButton(t('Sign In'), cssSigninButton.cls('-secondary'), + dom.on('click', () => { this._docPageModel?.clearUnsavedChanges(); }), dom.attr('href', use => { // Keep the redirect param of the login URL fresh. use(urlState().state); @@ -68,6 +69,7 @@ export class AccountWidget extends Disposable { testId('user-sign-in'), ), cssSigninButton(t('Sign Up'), + dom.on('click', () => { this._docPageModel?.clearUnsavedChanges(); }), dom.attr('href', use => { // Keep the redirect param of the signup URL fresh. use(urlState().state);