Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • benhayward.ben/mobile-native
  • minds/mobile-native
  • msantang78/mobile-native
  • edgebal/mobile-native
  • msantang78_test/mobile-native
  • duyquoc/mobile-native
  • priestd09/mobile-native
  • eiennohi/mobile-native
  • omadrid/mobile-native
  • sieuhuflit/mobile-native
  • juanmsolaro/mobile-native
  • ascenderking/mobile-native
  • jim-toth/mobile-native
  • thinnakrit/mobile-native-lang
  • project_connection/mobile-native
  • AaronTheBruce/mobile-native
  • cormac.kantargis.hack/mobile-native
  • xthread/mobile-native
  • Paulnguyenun/mobile-native
  • lustigdev/mobile-native
  • GubbenOlsson/mobile-native
  • calvinoea/mobile-native
  • namesty/mobile-native
  • mrrobot16/mobile-native
  • eliobricenov/mobile-native
  • bedriguler/mobile-native
  • m994/mobile-native
  • threetoes/mobile-native
  • liangel/mobile-native
  • hosituan/mobile-native
  • nacef.otay/mobile-native
  • madibaa/mobile-native
  • valentin129/mobile-native
  • manishoo/mobile-native1
  • th2tran/minds-mobile-native
35 results
Show changes
Commits on Source (2)
...@@ -4,6 +4,7 @@ import { ...@@ -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
...@@ -36,6 +37,7 @@ class HashtagStore { ...@@ -36,6 +37,7 @@ class HashtagStore {
@action @action
toggleAll() { toggleAll() {
this.all = !this.all; this.all = !this.all;
settingsStore.setUseHashtags(!this.all);
} }
/** /**
...@@ -44,6 +46,7 @@ class HashtagStore { ...@@ -44,6 +46,7 @@ class HashtagStore {
@action @action
setAll(value) { setAll(value) {
this.all = value; this.all = value;
settingsStore.setUseHashtags(!this.all);
} }
/** /**
......
...@@ -30,6 +30,7 @@ import testID from '../common/helpers/testID'; ...@@ -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
......
...@@ -2,6 +2,7 @@ import { observable, action } from 'mobx' ...@@ -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.
...@@ -13,6 +14,7 @@ class SettingsStore { ...@@ -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.
...@@ -20,12 +22,17 @@ class SettingsStore { ...@@ -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;
} }
...@@ -57,5 +64,10 @@ class SettingsStore { ...@@ -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;