(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
This commit is contained in:
Jarosław Sadziński 2023-10-10 15:49:36 +02:00
parent 988ab47376
commit a101337213

View File

@ -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);