2022-10-17 09:47:16 +00:00
|
|
|
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';
|
|
|
|
|
2023-08-08 09:36:02 +00:00
|
|
|
/**
|
|
|
|
* Are comments enabled by feature flag.
|
|
|
|
*/
|
2022-10-17 09:47:16 +00:00
|
|
|
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;
|
|
|
|
}
|
2023-03-23 18:22:28 +00:00
|
|
|
|
2023-08-08 09:36:02 +00:00
|
|
|
/**
|
|
|
|
* Does backend supports AI assistant.
|
|
|
|
*/
|
|
|
|
export function HAS_FORMULA_ASSISTANT() {
|
|
|
|
return Boolean(getGristConfig().featureFormulaAssistant);
|
2023-03-23 18:22:28 +00:00
|
|
|
}
|
2023-08-18 20:14:42 +00:00
|
|
|
|
|
|
|
export function WHICH_FORMULA_ASSISTANT() {
|
|
|
|
return getGristConfig().assistantService;
|
|
|
|
}
|