Loading src/common/stores/HashtagStore.js +3 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,7 @@ import { } from 'mobx'; } from 'mobx'; import hashtagService from '../services/hashtag.service' import hashtagService from '../services/hashtag.service' import settingsStore from '../../settings/SettingsStore'; /** /** * Hashtag * Hashtag Loading Loading @@ -36,6 +37,7 @@ class HashtagStore { @action @action toggleAll() { toggleAll() { this.all = !this.all; this.all = !this.all; settingsStore.setUseHashtags(!this.all); } } /** /** Loading @@ -44,6 +46,7 @@ class HashtagStore { @action @action setAll(value) { setAll(value) { this.all = value; this.all = value; settingsStore.setUseHashtags(!this.all); } } /** /** Loading src/discovery/NewsfeedFilters.js +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ import testID from '../common/helpers/testID'; import { GOOGLE_PLAY_STORE } from '../config/Config'; import { GOOGLE_PLAY_STORE } from '../config/Config'; import i18n from '../common/services/i18n.service'; import i18n from '../common/services/i18n.service'; import settingsStore from '../settings/SettingsStore'; /** /** * Newsfeed filters * Newsfeed filters Loading src/settings/SettingsStore.js +13 −1 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ import { observable, action } from 'mobx' import logService from '../common/services/log.service'; import logService from '../common/services/log.service'; import storageService from '../common/services/storage.service'; import storageService from '../common/services/storage.service'; import appStore from '../../AppStores'; /** /** * Store for the values held in Settings. * Store for the values held in Settings. Loading @@ -13,6 +14,7 @@ class SettingsStore { consumerNsfw = []; consumerNsfw = []; creatorNsfw = []; creatorNsfw = []; useHashtag = true; /** /** * Initializes local variables with their correct values as stored locally. * Initializes local variables with their correct values as stored locally. Loading @@ -20,12 +22,17 @@ class SettingsStore { */ */ @action.bound @action.bound async init() { async init() { const data = await storageService.multiGet(['LeftHanded', 'AppLog', 'CreatorNsfw', 'ConsumerNsfw']); const data = await storageService.multiGet(['LeftHanded', 'AppLog', 'CreatorNsfw', 'ConsumerNsfw', 'UseHashtags']); if (!data) return; if (!data) return; this.leftHanded = data[0][1]; this.leftHanded = data[0][1]; this.appLog = data[1][1]; this.appLog = data[1][1]; this.creatorNsfw = data[2][1] || []; this.creatorNsfw = data[2][1] || []; this.consumerNsfw = data[3][1] || []; this.consumerNsfw = data[3][1] || []; this.useHashtags = data[4][1] === null ? true : data[4][1]; // set the initial value for hashtag appStore.hashtag.setAll(!this.useHashtags); return this; return this; } } Loading Loading @@ -57,5 +64,10 @@ class SettingsStore { this.consumerNsfw = value; this.consumerNsfw = value; } } setUseHashtags(value) { storageService.setItem('UseHashtags', value); this.useHashtags = value; } } } export default new SettingsStore; export default new SettingsStore; Loading
src/common/stores/HashtagStore.js +3 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,7 @@ import { } from 'mobx'; } from 'mobx'; import hashtagService from '../services/hashtag.service' import hashtagService from '../services/hashtag.service' import settingsStore from '../../settings/SettingsStore'; /** /** * Hashtag * Hashtag Loading Loading @@ -36,6 +37,7 @@ class HashtagStore { @action @action toggleAll() { toggleAll() { this.all = !this.all; this.all = !this.all; settingsStore.setUseHashtags(!this.all); } } /** /** Loading @@ -44,6 +46,7 @@ class HashtagStore { @action @action setAll(value) { setAll(value) { this.all = value; this.all = value; settingsStore.setUseHashtags(!this.all); } } /** /** Loading
src/discovery/NewsfeedFilters.js +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ import testID from '../common/helpers/testID'; import { GOOGLE_PLAY_STORE } from '../config/Config'; import { GOOGLE_PLAY_STORE } from '../config/Config'; import i18n from '../common/services/i18n.service'; import i18n from '../common/services/i18n.service'; import settingsStore from '../settings/SettingsStore'; /** /** * Newsfeed filters * Newsfeed filters Loading
src/settings/SettingsStore.js +13 −1 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ import { observable, action } from 'mobx' import logService from '../common/services/log.service'; import logService from '../common/services/log.service'; import storageService from '../common/services/storage.service'; import storageService from '../common/services/storage.service'; import appStore from '../../AppStores'; /** /** * Store for the values held in Settings. * Store for the values held in Settings. Loading @@ -13,6 +14,7 @@ class SettingsStore { consumerNsfw = []; consumerNsfw = []; creatorNsfw = []; creatorNsfw = []; useHashtag = true; /** /** * Initializes local variables with their correct values as stored locally. * Initializes local variables with their correct values as stored locally. Loading @@ -20,12 +22,17 @@ class SettingsStore { */ */ @action.bound @action.bound async init() { async init() { const data = await storageService.multiGet(['LeftHanded', 'AppLog', 'CreatorNsfw', 'ConsumerNsfw']); const data = await storageService.multiGet(['LeftHanded', 'AppLog', 'CreatorNsfw', 'ConsumerNsfw', 'UseHashtags']); if (!data) return; if (!data) return; this.leftHanded = data[0][1]; this.leftHanded = data[0][1]; this.appLog = data[1][1]; this.appLog = data[1][1]; this.creatorNsfw = data[2][1] || []; this.creatorNsfw = data[2][1] || []; this.consumerNsfw = data[3][1] || []; this.consumerNsfw = data[3][1] || []; this.useHashtags = data[4][1] === null ? true : data[4][1]; // set the initial value for hashtag appStore.hashtag.setAll(!this.useHashtags); return this; return this; } } Loading Loading @@ -57,5 +64,10 @@ class SettingsStore { this.consumerNsfw = value; this.consumerNsfw = value; } } setUseHashtags(value) { storageService.setItem('UseHashtags', value); this.useHashtags = value; } } } export default new SettingsStore; export default new SettingsStore;