Skip to content

Commit a6d5135

Browse files
committed
wip
1 parent 7ce041a commit a6d5135

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/shared/diagnostic-overlay/diagnostic-overlay.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ h3 {
8383

8484
.tab-content {
8585
overflow: auto;
86-
padding: 8px;
86+
padding-bottom: 1em;
8787
}
8888

8989
.nav-wrapper {

src/SIL.XForge.Scripture/ClientApp/src/xforge-common/models/realtime-doc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Presence } from 'sharedb/lib/sharedb';
44
import { RealtimeService } from 'xforge-common/realtime.service';
55
import { PresenceData } from '../../app/shared/text/text.component';
66
import { RealtimeDocAdapter } from '../realtime-remote-store';
7+
import { isNG0911Error } from '../util/rxjs-util';
78
import { RealtimeOfflineData } from './realtime-offline-data';
89
import { Snapshot } from './snapshot';
910

@@ -44,8 +45,10 @@ export class DocSubscription {
4445
readonly callerContext: string,
4546
destroyRef?: DestroyRef
4647
) {
47-
if (destroyRef != null) {
48-
destroyRef.onDestroy(() => (this.isUnsubscribed = true));
48+
try {
49+
destroyRef?.onDestroy(() => (this.isUnsubscribed = true));
50+
} catch (error) {
51+
if (!isNG0911Error(error)) throw error;
4952
}
5053
}
5154

src/SIL.XForge.Scripture/ClientApp/src/xforge-common/util/rxjs-util.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export function filterNullish<T>(): OperatorFunction<T | undefined | null, T> {
1313
return filter((value): value is T => value != null);
1414
}
1515

16+
export function isNG0911Error(error: unknown): boolean {
17+
return hasStringProp(error, 'message') && error.message.includes('NG0911');
18+
}
19+
1620
/**
1721
* Like `takeUntilDestroyed`, but catches and logs NG0911 errors (unless `options.logWarnings` is false).
1822
*/
@@ -26,11 +30,10 @@ export function quietTakeUntilDestroyed<T>(
2630
try {
2731
return destroyRef.onDestroy(callback);
2832
} catch (error) {
29-
const isNG0911 = hasStringProp(error, 'message') && error.message.includes('NG0911');
30-
if (isNG0911 && options.logWarnings) {
33+
if (isNG0911Error(error) && options.logWarnings) {
3134
console.warn('NG0911 error caught and ignored. Original stack: ', stack);
3235
}
33-
if (!isNG0911) throw error;
36+
if (!isNG0911Error(error)) throw error;
3437
callback();
3538
return () => {};
3639
}

0 commit comments

Comments
 (0)