feat(web): add accepting subscription invites from UI
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
InternalEventBusInterface,
|
||||
} from '@standardnotes/services'
|
||||
|
||||
import { RootQueryParam } from './RootQueryParam'
|
||||
import { RouteParser } from './RouteParser'
|
||||
import { RouteParserInterface } from './RouteParserInterface'
|
||||
import { RouteServiceEvent } from './RouteServiceEvent'
|
||||
@@ -30,13 +31,13 @@ export class RouteService
|
||||
this.unsubApp()
|
||||
}
|
||||
|
||||
public getRoute(): RouteParserInterface {
|
||||
getRoute(): RouteParserInterface {
|
||||
return new RouteParser(window.location.href)
|
||||
}
|
||||
|
||||
public removeSettingsFromURLQueryParameters() {
|
||||
removeQueryParameterFromURL(param: RootQueryParam): void {
|
||||
const urlSearchParams = new URLSearchParams(window.location.search)
|
||||
urlSearchParams.delete('settings')
|
||||
urlSearchParams.delete(param)
|
||||
|
||||
const newUrl = `${window.location.origin}${window.location.pathname}${urlSearchParams.toString()}`
|
||||
window.history.replaceState(null, document.title, newUrl)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { RootQueryParam } from './RootQueryParam'
|
||||
import { RouteParserInterface } from './RouteParserInterface'
|
||||
|
||||
export interface RouteServiceInterface {
|
||||
deinit(): void
|
||||
getRoute(): RouteParserInterface
|
||||
removeSettingsFromURLQueryParameters(): void
|
||||
removeQueryParameterFromURL(param: RootQueryParam): void
|
||||
}
|
||||
|
||||
12
packages/ui-services/src/Toast/ToastService.ts
Normal file
12
packages/ui-services/src/Toast/ToastService.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { addToast, ToastType } from '@standardnotes/toast'
|
||||
|
||||
import { ToastServiceInterface } from './ToastServiceInterface'
|
||||
|
||||
export class ToastService implements ToastServiceInterface {
|
||||
showToast(type: ToastType, message: string): void {
|
||||
addToast({
|
||||
type: type,
|
||||
message,
|
||||
})
|
||||
}
|
||||
}
|
||||
5
packages/ui-services/src/Toast/ToastServiceInterface.ts
Normal file
5
packages/ui-services/src/Toast/ToastServiceInterface.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ToastType } from '@standardnotes/toast'
|
||||
|
||||
export interface ToastServiceInterface {
|
||||
showToast(type: ToastType, message: string): void
|
||||
}
|
||||
@@ -8,7 +8,9 @@ export * from './Route/Params/OnboardingParams'
|
||||
export * from './Route/Params/PurchaseParams'
|
||||
export * from './Route/Params/SettingsParams'
|
||||
export * from './Route/Params/SubscriptionInviteParams'
|
||||
export * from './Route/RootQueryParam'
|
||||
export * from './Route/RouteParser'
|
||||
export * from './Route/RouteParserInterface'
|
||||
export * from './Route/RouteType'
|
||||
export * from './Route/RouteService'
|
||||
export * from './Route/RouteServiceInterface'
|
||||
@@ -16,3 +18,5 @@ export * from './Route/RouteServiceEvent'
|
||||
export * from './Security/AutolockService'
|
||||
export * from './Storage/LocalStorage'
|
||||
export * from './Theme/ThemeManager'
|
||||
export * from './Toast/ToastService'
|
||||
export * from './Toast/ToastServiceInterface'
|
||||
|
||||
Reference in New Issue
Block a user