fix: revert webview alert changes (#1606)
This commit is contained in:
@@ -45,9 +45,7 @@ const WorkspaceSwitcherMenu: FunctionComponent<Props> = ({
|
|||||||
|
|
||||||
const signoutAll = useCallback(async () => {
|
const signoutAll = useCallback(async () => {
|
||||||
const confirmed = await viewControllerManager.application.alertService.confirm(
|
const confirmed = await viewControllerManager.application.alertService.confirm(
|
||||||
`Are you sure you want to sign out of all workspaces on this device?${
|
'Are you sure you want to sign out of all workspaces on this device?',
|
||||||
viewControllerManager.application.isNativeMobileWeb() && '<b> Your app will quit after sign out completes.</b>'
|
|
||||||
}`,
|
|
||||||
undefined,
|
undefined,
|
||||||
'Sign out all',
|
'Sign out all',
|
||||||
ButtonType.Danger,
|
ButtonType.Danger,
|
||||||
@@ -64,44 +62,14 @@ const WorkspaceSwitcherMenu: FunctionComponent<Props> = ({
|
|||||||
|
|
||||||
const activateWorkspace = useCallback(
|
const activateWorkspace = useCallback(
|
||||||
async (descriptor: ApplicationDescriptor) => {
|
async (descriptor: ApplicationDescriptor) => {
|
||||||
if (viewControllerManager.application.isNativeMobileWeb()) {
|
|
||||||
const confirmed = await viewControllerManager.application.alertService.confirm(
|
|
||||||
'<b>The app needs to be restarted to activate the workspace</b>',
|
|
||||||
undefined,
|
|
||||||
'Quit app and activate workspace',
|
|
||||||
ButtonType.Danger,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
void mainApplicationGroup.unloadCurrentAndActivateDescriptor(descriptor)
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
void mainApplicationGroup.unloadCurrentAndActivateDescriptor(descriptor)
|
void mainApplicationGroup.unloadCurrentAndActivateDescriptor(descriptor)
|
||||||
},
|
},
|
||||||
[mainApplicationGroup, viewControllerManager.application],
|
[mainApplicationGroup],
|
||||||
)
|
)
|
||||||
|
|
||||||
const addAnotherWorkspace = useCallback(async () => {
|
const addAnotherWorkspace = useCallback(async () => {
|
||||||
if (viewControllerManager.application.isNativeMobileWeb()) {
|
|
||||||
const confirmed = await viewControllerManager.application.alertService.confirm(
|
|
||||||
'<b>The app needs to be restarted to add another workspace</b>',
|
|
||||||
undefined,
|
|
||||||
'Quit app and add new workspace',
|
|
||||||
ButtonType.Danger,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
void mainApplicationGroup.unloadCurrentAndCreateNewDescriptor()
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
void mainApplicationGroup.unloadCurrentAndCreateNewDescriptor()
|
void mainApplicationGroup.unloadCurrentAndCreateNewDescriptor()
|
||||||
}, [mainApplicationGroup, viewControllerManager.application])
|
}, [mainApplicationGroup])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Menu a11yLabel="Workspace switcher menu" className="px-0 focus:shadow-none" isOpen={isOpen}>
|
<Menu a11yLabel="Workspace switcher menu" className="px-0 focus:shadow-none" isOpen={isOpen}>
|
||||||
|
|||||||
@@ -41,15 +41,7 @@ const ConfirmSignoutModal: FunctionComponent<Props> = ({ application, viewContro
|
|||||||
<AlertDialogLabel className="sk-h3 sk-panel-section-title">Sign out workspace?</AlertDialogLabel>
|
<AlertDialogLabel className="sk-h3 sk-panel-section-title">Sign out workspace?</AlertDialogLabel>
|
||||||
<AlertDialogDescription className="sk-panel-row">
|
<AlertDialogDescription className="sk-panel-row">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-foreground">
|
<p className="text-foreground">{STRING_SIGN_OUT_CONFIRMATION}</p>
|
||||||
{STRING_SIGN_OUT_CONFIRMATION}
|
|
||||||
{application.isNativeMobileWeb() && (
|
|
||||||
<div className="font-bold">
|
|
||||||
<br />
|
|
||||||
Your app will quit after sign out completes.
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
{showWorkspaceWarning && (
|
{showWorkspaceWarning && (
|
||||||
<>
|
<>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Reference in New Issue
Block a user