mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-27 11:06:50 +03:00
UBER-1150 Expose collaborative provider loaded state (#3934)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
parent
273ecb42ce
commit
136b9cb7e9
@ -96,14 +96,7 @@
|
||||
})
|
||||
|
||||
let loading = true
|
||||
|
||||
if (contextProvider === undefined) {
|
||||
provider?.on('synced', () => {
|
||||
loading = false
|
||||
})
|
||||
} else {
|
||||
loading = false
|
||||
}
|
||||
provider.loaded.then(() => (loading = false))
|
||||
|
||||
const currentUser = getCurrentAccount()
|
||||
|
||||
|
@ -19,8 +19,14 @@ export type TiptapCollabProviderConfiguration = HocuspocusProviderConfiguration
|
||||
Required<Pick<HocuspocusProviderConfiguration, 'token'>>
|
||||
|
||||
export class TiptapCollabProvider extends HocuspocusProvider {
|
||||
loaded: Promise<void>
|
||||
|
||||
constructor (configuration: TiptapCollabProviderConfiguration) {
|
||||
super(configuration as HocuspocusProviderConfiguration)
|
||||
|
||||
this.loaded = new Promise((resolve) => {
|
||||
this.on('synced', resolve)
|
||||
})
|
||||
}
|
||||
|
||||
copyContent (sourceId: string, targetId: string): void {
|
||||
|
Loading…
Reference in New Issue
Block a user