chore: copy and style improvements
This commit is contained in:
@@ -27,7 +27,7 @@ import { PurchaseFlowController } from '@/Controllers/PurchaseFlow/PurchaseFlowC
|
||||
import { SyncStatusController } from '@/Controllers/SyncStatusController'
|
||||
import { AccountMenuPane } from '@/Components/AccountMenu/AccountMenuPane'
|
||||
|
||||
import { ApplicationEventObserver } from './ApplicationEventObserver'
|
||||
import { ApplicationEventObserver, JoinWorkspaceSuccessString } from './ApplicationEventObserver'
|
||||
import { WebApplication } from '@/Application/Application'
|
||||
|
||||
describe('ApplicationEventObserver', () => {
|
||||
@@ -169,10 +169,7 @@ describe('ApplicationEventObserver', () => {
|
||||
await createObserver().handle(ApplicationEvent.Launched)
|
||||
|
||||
expect(subscriptionManager.acceptInvitation).toHaveBeenCalledWith('1-2-3')
|
||||
expect(toastService.showToast).toHaveBeenCalledWith(
|
||||
ToastType.Success,
|
||||
'Successfully joined a shared subscription',
|
||||
)
|
||||
expect(toastService.showToast).toHaveBeenCalledWith(ToastType.Success, JoinWorkspaceSuccessString)
|
||||
expect(routeService.removeQueryParameterFromURL).toHaveBeenCalledWith(RootQueryParam.AcceptSubscriptionInvite)
|
||||
})
|
||||
|
||||
@@ -278,10 +275,7 @@ describe('ApplicationEventObserver', () => {
|
||||
await createObserver().handle(ApplicationEvent.SignedIn)
|
||||
|
||||
expect(subscriptionManager.acceptInvitation).toHaveBeenCalledWith('1-2-3')
|
||||
expect(toastService.showToast).toHaveBeenCalledWith(
|
||||
ToastType.Success,
|
||||
'Successfully joined a shared subscription',
|
||||
)
|
||||
expect(toastService.showToast).toHaveBeenCalledWith(ToastType.Success, JoinWorkspaceSuccessString)
|
||||
expect(routeService.removeQueryParameterFromURL).toHaveBeenCalledWith(RootQueryParam.AcceptSubscriptionInvite)
|
||||
})
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ import { AccountMenuPane } from '@/Components/AccountMenu/AccountMenuPane'
|
||||
import { EventObserverInterface } from './EventObserverInterface'
|
||||
import { WebApplication } from '@/Application/Application'
|
||||
|
||||
export const JoinWorkspaceSuccessString =
|
||||
'Successfully joined a shared subscription. You may have to sign out and back in for changes to take effect.'
|
||||
|
||||
export class ApplicationEventObserver implements EventObserverInterface {
|
||||
constructor(
|
||||
private application: WebApplication,
|
||||
@@ -129,7 +132,7 @@ export class ApplicationEventObserver implements EventObserverInterface {
|
||||
this.toastService.hideToast(processingToastId)
|
||||
|
||||
const toastType = acceptResult.success ? ToastType.Success : ToastType.Error
|
||||
const toastMessage = acceptResult.success ? 'Successfully joined a shared subscription' : acceptResult.message
|
||||
const toastMessage = acceptResult.success ? JoinWorkspaceSuccessString : acceptResult.message
|
||||
|
||||
this.toastService.showToast(toastType, toastMessage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user