mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
13 lines
502 B
TypeScript
13 lines
502 B
TypeScript
|
import {getGristConfig} from 'app/common/urlUtils';
|
||
|
import {get as getBrowserGlobals} from 'app/client/lib/browserGlobals';
|
||
|
import {localStorageBoolObs} from 'app/client/lib/localStorageObs';
|
||
|
import {Observable} from 'grainjs';
|
||
|
|
||
|
export function COMMENTS(): Observable<boolean> {
|
||
|
const G = getBrowserGlobals('document', 'window');
|
||
|
if (!G.window.COMMENTS) {
|
||
|
G.window.COMMENTS = localStorageBoolObs('feature-comments', Boolean(getGristConfig().featureComments));
|
||
|
}
|
||
|
return G.window.COMMENTS;
|
||
|
}
|