mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
d29770511c
Summary: The feature is behind a flag GRIST_FORMULA_ASSISTANT (must be "true"). But can be enabled in the developer console by invoking GRIST_FORMULA_ASSISTANT.set(true). Keys can be overriden in the document settings page. Test Plan: For now just a stub test that checks if this feature is disabled by default. Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3815
22 lines
857 B
TypeScript
22 lines
857 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;
|
|
}
|
|
|
|
export function GRIST_FORMULA_ASSISTANT(): Observable<boolean> {
|
|
const G = getBrowserGlobals('document', 'window');
|
|
if (!G.window.GRIST_FORMULA_ASSISTANT) {
|
|
G.window.GRIST_FORMULA_ASSISTANT =
|
|
localStorageBoolObs('GRIST_FORMULA_ASSISTANT', Boolean(getGristConfig().featureFormulaAssistant));
|
|
}
|
|
return G.window.GRIST_FORMULA_ASSISTANT;
|
|
}
|