Skip to content

Commit 658ee30

Browse files
committed
Get analytics settings on app load
1 parent f522c91 commit 658ee30

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/pages/app-root/app-root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class AppRoot {
4040
}
4141

4242
async componentWillLoad() {
43-
if (await SettingsService.getAnalyticsSetting()) {
43+
if (await SettingsService.getAnalyticsSetting(true)) {
4444
Sentry.init({
4545
dsn: 'https://2b0b525209b646f49e438cff86c3e117@sentry.io/1331915',
4646
release: 'block-photos@2.0'

src/services/settings-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import StorageService from './storage-service';
22

33
export default class SettingsService {
4-
static async getAnalyticsSetting(): Promise<boolean> {
5-
return (await StorageService.getItem('analytics-settings')) === 'true';
4+
static async getAnalyticsSetting(updateCache?: boolean): Promise<boolean> {
5+
return (
6+
(await StorageService.getItem('analytics-settings', updateCache)) ===
7+
'true'
8+
);
69
}
710

811
static async setAnalyticsSetting(allowAnalytics: boolean): Promise<any> {

0 commit comments

Comments
 (0)