git ssb

1+

Daan Patchwork / manyverse



Commit 8ea2eb2ad8ce53a97c5472c0778197e1edd6bfa5

dx: update prettier and reapply it

Andre Staltz committed on 9/28/2020, 12:21:08 PM
Parent: d7d8f94a65cea2ea90d2de1eb2c52c2c3223fb37

Files changed

package-lock.jsonchanged
package.jsonchanged
src/backend/loader.desktop.tschanged
src/backend/loader.mobile.tschanged
src/backend/plugins/publishUtilsBack.tschanged
src/backend/restore.tschanged
src/desktop/index.tschanged
src/desktop/ssb/client.tschanged
src/frontend/components/AccountsListCheckMany.tschanged
src/frontend/components/RNBridgeDebug.tschanged
src/frontend/components/messageEtc.tschanged
src/frontend/components/messages/MessageFooter.tschanged
src/frontend/components/messages/PostMessage.tschanged
src/frontend/drivers/dialogs.tschanged
src/frontend/drivers/localization.tschanged
src/frontend/drivers/orientation.tschanged
src/frontend/drivers/ssb.tschanged
src/frontend/drivers/toast.tschanged
src/frontend/screens/accounts/index.tschanged
src/frontend/screens/backup/index.tschanged
src/frontend/screens/biography/index.tschanged
src/frontend/screens/biography/view.tschanged
src/frontend/screens/central/connections-tab/alert.tschanged
src/frontend/screens/central/connections-tab/asyncstorage.tschanged
src/frontend/screens/central/connections-tab/dialog.tschanged
src/frontend/screens/central/connections-tab/fab.tschanged
src/frontend/screens/central/connections-tab/index.tschanged
src/frontend/screens/central/connections-tab/intent.tschanged
src/frontend/screens/central/connections-tab/model.tschanged
src/frontend/screens/central/connections-tab/ssb.tschanged
src/frontend/screens/central/connections-tab/view/Body/PopList.tschanged
src/frontend/screens/central/connections-tab/view/SlideInMenu.tschanged
src/frontend/screens/central/connections-tab/view/index.tschanged
src/frontend/screens/central/private-tab/fab.tschanged
src/frontend/screens/central/private-tab/intent.tschanged
src/frontend/screens/central/private-tab/navigation.tschanged
src/frontend/screens/central/private-tab/view.tschanged
src/frontend/screens/central/public-tab/fab.tschanged
src/frontend/screens/central/public-tab/intent.tschanged
src/frontend/screens/central/public-tab/navigation.tschanged
src/frontend/screens/central/top-bar/index.tschanged
src/frontend/screens/central/view.tschanged
src/frontend/screens/compose/asyncstorage.tschanged
src/frontend/screens/compose/dialog.tschanged
src/frontend/screens/compose/intent.tschanged
src/frontend/screens/compose/model.tschanged
src/frontend/screens/compose/top-bar/index.tschanged
src/frontend/screens/compose/view.tschanged
src/frontend/screens/conversation/intent.tschanged
src/frontend/screens/conversation/model.tschanged
src/frontend/screens/conversation/ssb.tschanged
src/frontend/screens/conversation/view.tschanged
src/frontend/screens/drawer/intent.tschanged
src/frontend/screens/drawer/model.tschanged
src/frontend/screens/drawer/navigation.tschanged
src/frontend/screens/drawer/view.tschanged
src/frontend/screens/global/localization.tschanged
src/frontend/screens/invite-create/index.tschanged
src/frontend/screens/invite-create/model.tschanged
src/frontend/screens/invite-create/view.tschanged
src/frontend/screens/invite-paste/intent.tschanged
src/frontend/screens/invite-paste/model.tschanged
src/frontend/screens/invite-paste/ssb.tschanged
src/frontend/screens/invite-paste/view.tschanged
src/frontend/screens/profile-edit/intent.tschanged
src/frontend/screens/profile-edit/model.tschanged
src/frontend/screens/profile-edit/ssb.tschanged
src/frontend/screens/profile-edit/view.tschanged
src/frontend/screens/profile/ssb.tschanged
src/frontend/screens/raw-db/index.tschanged
src/frontend/screens/raw-msg/index.tschanged
src/frontend/screens/recipients-input/intent.tschanged
src/frontend/screens/recipients-input/model.tschanged
src/frontend/screens/recipients-input/navigation.tschanged
src/frontend/screens/recipients-input/view.tschanged
src/frontend/screens/secret-input/dialog.tschanged
src/frontend/screens/secret-input/model.tschanged
src/frontend/screens/secret-input/navigation.tschanged
src/frontend/screens/secret-input/view.tschanged
src/frontend/screens/secret-output/index.tschanged
src/frontend/screens/settings/intent.tschanged
src/frontend/screens/settings/model.tschanged
src/frontend/screens/settings/ssb.tschanged
src/frontend/screens/settings/view/index.tschanged
src/frontend/screens/thread/asyncstorage.tschanged
src/frontend/screens/thread/intent.tschanged
src/frontend/screens/thread/model.tschanged
src/frontend/screens/thread/navigation.tschanged
src/frontend/screens/thread/ssb.tschanged
src/frontend/screens/thread/view.tschanged
src/frontend/screens/welcome/index.tschanged
src/frontend/screens/welcome/model.tschanged
src/frontend/screens/welcome/navigation.tschanged
src/frontend/ssb/plugins/connUtils.tschanged
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 882642 bytes
New file size: 882783 bytes
package.jsonView
@@ -150,10 +150,10 @@
150150 "metro-react-native-babel-preset": "^0.56.0",
151151 "node-gyp-build": "4.2.2",
152152 "ora": "^5.0.0",
153153 "patch-package": "6.2.2",
154- "prettier": "~2.1.1",
155- "pretty-quick": "~3.0.0",
154+ "prettier": "~2.1.2",
155+ "pretty-quick": "~3.0.2",
156156 "propagate-replacement-fields": "1.2.0",
157157 "react-native-version": "4.0.0",
158158 "rn-snoopy": "2.0.2",
159159 "tslint": "~6.1.3",
@@ -174,5 +174,5 @@
174174 },
175175 "react-native": {
176176 "os": "react-native-os-staltz"
177177 }
178-}
178+}
src/backend/loader.desktop.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -25,9 +25,9 @@
2525 let win: BrowserWindow | null;
2626
2727 let resolveWebContents: ((wc: WebContents) => void) | undefined;
2828 // This will be used by multiserver to communicate with the frontend
29-(process as any).webContentsP = new Promise(resolve => {
29+(process as any).webContentsP = new Promise((resolve) => {
3030 resolveWebContents = resolve;
3131 });
3232
3333 function createWindow() {
@@ -77,9 +77,9 @@
7777 const data = res.profile || res.result;
7878 const date = new Date();
7979 const dir = path.resolve(process.env.SSB_DIR!, 'manyverse');
8080 const file = `${dir}/flamechart_${date.getTime()}.json`;
81- fs.writeFile(file, JSON.stringify(data), err2 => {
81+ fs.writeFile(file, JSON.stringify(data), (err2) => {
8282 if (err2) console.error(err2);
8383 });
8484 });
8585 }, 20e3);
src/backend/loader.mobile.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -34,9 +34,9 @@
3434 setTimeout(() => {
3535 process.exit(1);
3636 });
3737 });
38-process.on('uncaughtException', err => {
38+process.on('uncaughtException', (err) => {
3939 if (typeof err === 'string') {
4040 rnBridge.channel.post('exception', err);
4141 } else {
4242 rnBridge.channel.post('exception', err.message + '\n' + err.stack);
@@ -79,9 +79,9 @@
7979 if (err) return console.error(err);
8080 const data = res.profile || res.result;
8181 const date = new Date();
8282 const file = `${nodejsProjectDir}/flamechart_${date.getTime()}.json`;
83- fs.writeFile(file, JSON.stringify(data), err2 => {
83+ fs.writeFile(file, JSON.stringify(data), (err2) => {
8484 if (err2) console.error(err2);
8585 });
8686 });
8787 }, 20e3);
src/backend/plugins/publishUtilsBack.tsView
@@ -51,9 +51,9 @@
5151 content.recps
5252 .map((e: FeedId | Record<string, any>) =>
5353 Ref.isFeed(e) ? e : Ref.isFeed(e.link) ? e.link : void 0,
5454 )
55- .filter(x => !!x),
55+ .filter((x) => !!x),
5656 );
5757 } catch (e) {
5858 return cb(e);
5959 }
src/backend/restore.tsView
@@ -29,9 +29,9 @@
2929 const flumeLogSize = fileSize(flumeLogPath);
3030 if (flumeLogSize >= 10) return 'OVERWRITE_RISK';
3131
3232 // Basic validation of input words
33- const wordsArr = words.split(' ').map(s => s.trim().toLowerCase());
33+ const wordsArr = words.split(' ').map((s) => s.trim().toLowerCase());
3434 if (wordsArr.length < 24) return 'TOO_SHORT';
3535 if (wordsArr.length > 48) return 'TOO_LONG';
3636
3737 // Convert words to keys
src/desktop/index.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -33,17 +33,17 @@
3333
3434 // Lodash, currently included via a script, is required for this line to work
3535 element.innerHTML = 'Frontend JS activated';
3636
37- makeClient().then(ssb => {
37+ makeClient().then((ssb) => {
3838 pull(
3939 ssb.conn.peers(),
4040 pull.drain((peers: Array<any>) => {
4141 element.innerHTML =
4242 '<ul>' +
4343 peers
44- .map(peer => peer[1].name || peer[1].key || '?')
45- .map(name => `<li>${name}</li>`)
44+ .map((peer) => peer[1].name || peer[1].key || '?')
45+ .map((name) => `<li>${name}</li>`)
4646 .join('\n') +
4747 '</ul>';
4848 }),
4949 );
src/desktop/ssb/client.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -8,10 +8,8 @@
88 import cachedAbout from 'ssb-cached-about';
99 import manifest from './manifest';
1010
1111 function makeClient() {
12- return ssbClient(manifest)
13- .use(cachedAbout())
14- .callPromise();
12+ return ssbClient(manifest).use(cachedAbout()).callPromise();
1513 }
1614
1715 export default makeClient;
src/frontend/components/AccountsListCheckMany.tsView
@@ -158,9 +158,9 @@
158158 const displayAccounts: typeof accounts = [];
159159 let checkSet: Set<FeedId> | undefined = new Set<FeedId>();
160160 for (const a of checked) {
161161 checkSet.add(a.id);
162- if (accounts.findIndex(x => x.id === a.id) === -1) {
162+ if (accounts.findIndex((x) => x.id === a.id) === -1) {
163163 (a as any)._retained = true;
164164 displayAccounts.push(a);
165165 }
166166 }
@@ -180,9 +180,9 @@
180180 const displayAccounts = this.getDisplayAccounts();
181181
182182 return h(
183183 Fragment,
184- displayAccounts.map(account => {
184+ displayAccounts.map((account) => {
185185 const {id, name, imageUrl} = account;
186186 const isChecked = (account as any)._retained;
187187 return h<AccountProps>(Account, {
188188 key: id,
@@ -191,9 +191,9 @@
191191 id,
192192 isChecked,
193193 onPress: () => {
194194 if (isChecked) {
195- const newChecked = checked.filter(x => x.id !== id);
195+ const newChecked = checked.filter((x) => x.id !== id);
196196 this.setState({checked: newChecked});
197197 onUpdated?.(newChecked);
198198 } else if (checked.length < max) {
199199 const newChecked = checked.concat([account]);
src/frontend/components/RNBridgeDebug.tsView
@@ -49,9 +49,9 @@
4949 $(
5050 Text,
5151 {style: styles.chart},
5252 this.state.stress
53- .map(x => {
53+ .map((x) => {
5454 if (x === 0) return ' ';
5555 const y = Math.min(x, MAX_STRESS) / MAX_STRESS;
5656 if (y < 0.14) return 'โ–';
5757 if (y < 0.28) return 'โ–‚';
@@ -69,9 +69,9 @@
6969 public componentDidMount() {
7070 const emitter = new EventEmitter();
7171 const events = Snoopy.stream(emitter);
7272 buffer(1000)(events).subscribe((x: any) => {
73- this.setState(prev => {
73+ this.setState((prev) => {
7474 prev.stress.shift();
7575 prev.stress.push(x.length);
7676 return {stress: prev.stress};
7777 });
src/frontend/components/messageEtc.tsView
@@ -26,9 +26,9 @@
2626 };
2727
2828 export default function messageEtc(sources: Sources): Sinks {
2929 const messageEtcChoice$ = sources.appear$
30- .map(msg =>
30+ .map((msg) =>
3131 sources.dialog
3232 .showPicker(
3333 Platform.OS === 'ios'
3434 ? t('message.call_to_action.etc.dialog_title')
@@ -46,20 +46,20 @@
4646 negativeText: '',
4747 neutralText: '',
4848 },
4949 )
50- .filter(res => res.action === 'actionSelect')
50+ .filter((res) => res.action === 'actionSelect')
5151 .map((res: any) => ({id: res.selectedItem.id as EtcChoiceId, msg})),
5252 )
5353 .flatten();
5454
5555 const goToRawMsg$ = messageEtcChoice$
56- .filter(choice => choice.id === 'raw-msg')
57- .map(choice => choice.msg);
56+ .filter((choice) => choice.id === 'raw-msg')
57+ .map((choice) => choice.msg);
5858
5959 const copyCypherlink$ = messageEtcChoice$
60- .filter(choice => choice.id === 'copy-id')
61- .map(choice => choice.msg.key);
60+ .filter((choice) => choice.id === 'copy-id')
61+ .map((choice) => choice.msg.key);
6262
6363 const toast$ = copyCypherlink$.mapTo({
6464 type: 'show',
6565 message: t('message.toast.copied_to_clipboard'),
src/frontend/components/messages/MessageFooter.tsView
@@ -382,9 +382,9 @@
382382 };
383383
384384 private onPressAddReactionHandler = () => {
385385 if (this.myReaction === null) {
386- this.setState(prev => ({showQuickEmojis: !prev.showQuickEmojis}));
386+ this.setState((prev) => ({showQuickEmojis: !prev.showQuickEmojis}));
387387 } else {
388388 this.props.onPressAddReaction?.({
389389 msgKey: this.props.msg.key,
390390 value: 0,
src/frontend/components/messages/PostMessage.tsView
@@ -64,9 +64,9 @@
6464 this.state = {cwOpened: props.expandCW ?? false};
6565 }
6666
6767 public onPressToggleCW = () => {
68- this.setState(prev => ({cwOpened: !prev.cwOpened}));
68+ this.setState((prev) => ({cwOpened: !prev.cwOpened}));
6969 };
7070
7171 public render() {
7272 const props = this.props;
src/frontend/drivers/dialogs.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -194,9 +194,9 @@
194194 }
195195
196196 export function dialogDriver(command$: Stream<Command>): DialogSource {
197197 command$.subscribe({
198- next: cmd => {
198+ next: (cmd) => {
199199 if (cmd.type === 'dismiss') {
200200 DialogAndroid.dismiss();
201201 }
202202 if (cmd.type === 'alert') {
src/frontend/drivers/localization.tsView
@@ -24,9 +24,9 @@
2424
2525 export function makeLocalizationDriver() {
2626 return function localizationDriver(sink: Stream<Command>): Stream<void> {
2727 sink.subscribe({
28- next: cmd => {
28+ next: (cmd) => {
2929 i18n.fallbacks = true;
3030 i18n.defaultLocale = cmd.defaultLocale;
3131 i18n.locale = cmd.locale;
3232 i18n.translations = cmd.translations;
src/frontend/drivers/orientation.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -17,9 +17,9 @@
1717 listener.next(ori);
1818 };
1919 listener.next(Orientation.getInitialOrientation());
2020 Orientation.addOrientationListener(this.fn);
21- Orientation.getOrientation(ori => {
21+ Orientation.getOrientation((ori) => {
2222 listener.next(ori);
2323 });
2424 },
2525
src/frontend/drivers/ssb.tsView
@@ -72,77 +72,71 @@
7272 public stagedPeers$: Stream<Array<StagedPeerKV>>;
7373 public bluetoothScanState$: Stream<any>;
7474
7575 constructor(ssbP: Promise<SSBClient>) {
76- this.ssb$ = xs
77- .fromPromise(ssbP)
78- .compose(dropCompletion)
79- .remember();
76+ this.ssb$ = xs.fromPromise(ssbP).compose(dropCompletion).remember();
8077
81- this.selfFeedId$ = this.ssb$.map(ssb => ssb.id).remember();
78+ this.selfFeedId$ = this.ssb$.map((ssb) => ssb.id).remember();
8279
83- this.publicRawFeed$ = this.ssb$.map(ssb => (opts?: any) =>
80+ this.publicRawFeed$ = this.ssb$.map((ssb) => (opts?: any) =>
8481 ssb.threadsUtils.publicRawFeed(opts),
8582 );
8683
87- this.publicFeed$ = this.ssb$.map(ssb => (opts?: any) =>
84+ this.publicFeed$ = this.ssb$.map((ssb) => (opts?: any) =>
8885 ssb.threadsUtils.publicFeed(opts),
8986 );
9087
91- this.publicLiveUpdates$ = this.fromPullStream(ssb =>
88+ this.publicLiveUpdates$ = this.fromPullStream((ssb) =>
9289 ssb.threadsUtils.publicUpdates(),
9390 ).mapTo(null);
9491
95- this.privateFeed$ = this.ssb$.map(ssb => (opts?: any) =>
92+ this.privateFeed$ = this.ssb$.map((ssb) => (opts?: any) =>
9693 ssb.threadsUtils.privateFeed(opts),
9794 );
9895
99- this.privateLiveUpdates$ = this.fromPullStream<MsgId>(ssb =>
96+ this.privateLiveUpdates$ = this.fromPullStream<MsgId>((ssb) =>
10097 ssb.threadsUtils.privateUpdates(),
10198 );
10299
103- this.isSyncing$ = this.fromPullStream(ssb => ssb.syncing.stream()).map(
100+ this.isSyncing$ = this.fromPullStream((ssb) => ssb.syncing.stream()).map(
104101 (resp: any) => resp.started > 0,
105102 );
106103
107- this.selfPublicRoots$ = this.ssb$.map(ssb => (opts?: any) =>
104+ this.selfPublicRoots$ = this.ssb$.map((ssb) => (opts?: any) =>
108105 ssb.threadsUtils.selfPublicRoots(opts),
109106 );
110107
111- this.selfPrivateRoots$ = this.fromPullStream<Msg>(ssb =>
108+ this.selfPrivateRoots$ = this.fromPullStream<Msg>((ssb) =>
112109 ssb.threadsUtils.selfPrivateRoots(),
113110 );
114111
115- this.selfReplies$ = this.ssb$.map(ssb => (opts?: any) =>
112+ this.selfReplies$ = this.ssb$.map((ssb) => (opts?: any) =>
116113 ssb.threadsUtils.selfReplies(opts),
117114 );
118115
119116 this.publishHook$ = this.ssb$
120- .map(ssb => ssb.hooks.publishStream())
117+ .map((ssb) => ssb.hooks.publishStream())
121118 .flatten();
122119
123120 this.acceptInviteResponse$ = xs.create<true | string>();
124121 this.acceptDhtInviteResponse$ = xs.create<true | string>();
125122
126- this.peers$ = this.fromPullStream<Array<PeerKV>>(ssb =>
123+ this.peers$ = this.fromPullStream<Array<PeerKV>>((ssb) =>
127124 ssb.connUtils.peers(),
128125 );
129126
130- this.stagedPeers$ = this.fromPullStream<Array<StagedPeerKV>>(ssb =>
127+ this.stagedPeers$ = this.fromPullStream<Array<StagedPeerKV>>((ssb) =>
131128 ssb.connUtils.stagedPeers(),
132129 );
133130
134131 this.bluetoothScanState$ =
135132 Platform.OS === 'ios' // TODO: remove this, because the backend checks too
136133 ? xs.empty()
137- : this.fromPullStream(ssb => ssb.bluetooth.bluetoothScanState());
134+ : this.fromPullStream((ssb) => ssb.bluetooth.bluetoothScanState());
138135 }
139136
140137 private fromPullStream<T>(fn: (ssb: SSBClient) => Readable<T>): Stream<T> {
141- return this.ssb$
142- .map(fn)
143- .map(xsFromPullStream)
144- .flatten() as Stream<T>;
138+ return this.ssb$.map(fn).map(xsFromPullStream).flatten() as Stream<T>;
145139 }
146140
147141 private fromCallback<T>(
148142 fn: (ssb: SSBClient, cb: Callback<T>) => void,
@@ -159,9 +153,9 @@
159153 public threadUpdates$(
160154 rootMsgId: MsgId,
161155 privately: boolean,
162156 ): Stream<MsgAndExtras> {
163- return this.fromPullStream<MsgAndExtras>(ssb =>
157+ return this.fromPullStream<MsgAndExtras>((ssb) =>
164158 ssb.threadsUtils.threadUpdates({root: rootMsgId, private: privately}),
165159 );
166160 }
167161
@@ -173,16 +167,16 @@
173167
174168 public profileFeed$(
175169 id: FeedId,
176170 ): Stream<GetReadable<ThreadSummaryWithExtras>> {
177- return this.ssb$.map(ssb => (opts?: any) =>
171+ return this.ssb$.map((ssb) => (opts?: any) =>
178172 ssb.threadsUtils.profileFeed(id, opts),
179173 );
180174 }
181175
182176 public liteAbout$(ids: Array<FeedId>): Stream<Array<AboutAndExtras>> {
183177 return this.ssb$
184- .map(async ssb => {
178+ .map(async (ssb) => {
185179 const getAbout = ssb.cachedAbout.socialValue;
186180 const abouts: Array<AboutAndExtras> = [];
187181 for (const id of ids) {
188182 // Fetch name
@@ -201,15 +195,15 @@
201195 abouts.push({name, imageUrl, id});
202196 }
203197 return abouts;
204198 })
205- .map(promise => xs.fromPromise(promise))
199+ .map((promise) => xs.fromPromise(promise))
206200 .flatten();
207201 }
208202
209203 public profileAbout$(id: FeedId): Stream<AboutAndExtras> {
210204 return this.ssb$
211- .map(ssb => {
205+ .map((ssb) => {
212206 const selfId = ssb.id;
213207 const color = colorHash.hex(id);
214208 const getAbout = ssb.cachedAbout.socialValue;
215209 const getAbout$ = xsFromCallback(getAbout);
@@ -239,9 +233,9 @@
239233 }
240234
241235 public profileAboutLive$(id: FeedId): Stream<AboutAndExtras> {
242236 return this.ssb$
243- .map(ssb => {
237+ .map((ssb) => {
244238 const selfId = ssb.id;
245239 const color = colorHash.hex(id);
246240 const getAboutPS = ssb.about.socialValueStream;
247241 const name$ = xsFromPullStream(getAboutPS({key: 'name', dest: id}));
@@ -290,9 +284,9 @@
290284 });
291285 }
292286
293287 public isPrivatelyBlocking$(dest: FeedId): Stream<boolean> {
294- return this.fromPullStream<boolean>(ssb =>
288+ return this.fromPullStream<boolean>((ssb) =>
295289 ssb.friendsUtils.isPrivatelyBlockingStream(dest),
296290 );
297291 }
298292
@@ -304,14 +298,14 @@
304298 const opts: Record<string, any> = {limit: 10};
305299 if (!!text) opts.text = text;
306300 if (authors.length) opts.defaultIds = authors;
307301 return this.ssb$
308- .map(ssb =>
302+ .map((ssb) =>
309303 xsFromCallback<Array<MentionSuggestion>>(ssb.suggest.profile)(opts).map(
310- arr =>
304+ (arr) =>
311305 arr
312- .filter(suggestion => suggestion.id !== ssb.id)
313- .map(suggestion => ({
306+ .filter((suggestion) => suggestion.id !== ssb.id)
307+ .map((suggestion) => ({
314308 ...suggestion,
315309 imageUrl: imageToImageUrl(suggestion.image),
316310 })),
317311 ),
@@ -461,9 +455,9 @@
461455 source: SSBSource,
462456 ssbP: Promise<SSBClient>,
463457 ) {
464458 sink
465- .filter(r => r.type === 'identity.create' || r.type === 'identity.use')
459+ .filter((r) => r.type === 'identity.create' || r.type === 'identity.use')
466460 .take(1)
467461 .addListener({
468462 next(r) {
469463 if (r.type === 'identity.create') {
@@ -477,9 +471,9 @@
477471
478472 const ssb = await ssbP;
479473
480474 sink.addListener({
481- next: async req => {
475+ next: async (req) => {
482476 if (req.type === 'publish') {
483477 ssb.publishUtils.publish(req.content);
484478 return;
485479 }
@@ -671,9 +665,9 @@
671665 });
672666 }
673667
674668 function waitForIdentity() {
675- return new Promise<boolean>(resolve => {
669+ return new Promise<boolean>((resolve) => {
676670 nodejs.channel.addListener('identity', (msg: RestoreIdentityResponse) => {
677671 if (msg === 'IDENTITY_READY') resolve(true);
678672 });
679673 });
src/frontend/drivers/toast.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -36,9 +36,9 @@
3636
3737 export function makeToastDriver() {
3838 return function toastDriver(sink: Stream<Toast | GravityToast>): void {
3939 sink.addListener({
40- next: t => {
40+ next: (t) => {
4141 if (Platform.OS === 'android') {
4242 const flavorPrefix =
4343 t.flavor === 'success'
4444 ? '\u2713 '
@@ -48,9 +48,9 @@
4848 const args = [
4949 flavorPrefix + t.message,
5050 t.duration,
5151 (t as GravityToast).gravity,
52- ].filter(x => typeof x !== 'undefined');
52+ ].filter((x) => typeof x !== 'undefined');
5353 (ToastAndroid[t.type] as any)(...args);
5454 } else {
5555 if (t.flavor === 'success') {
5656 ToastIOS.showSuccess(t.message, {
src/frontend/screens/accounts/index.tsView
@@ -108,9 +108,9 @@
108108
109109 export function accounts(sources: Sources): Sinks {
110110 const actions = intent(sources.navigation, sources.screen);
111111
112- const vdom$ = sources.state.stream.map(state => {
112+ const vdom$ = sources.state.stream.map((state) => {
113113 const abouts = state.abouts;
114114
115115 return h(View, {style: styles.screen}, [
116116 h(TopBar, {sel: 'topbar', title: state.title}),
@@ -141,10 +141,10 @@
141141 },
142142 );
143143
144144 const aboutsReducer$ = sources.props
145- .filter(props => !!props.accounts)
146- .map(props => {
145+ .filter((props) => !!props.accounts)
146+ .map((props) => {
147147 const hasReactions =
148148 props.accounts &&
149149 props.accounts.length >= 1 &&
150150 Array.isArray(props.accounts[0]);
@@ -153,16 +153,16 @@
153153 hasReactions ? (props.accounts as Array<[FeedId, string]>) : undefined,
154154 );
155155
156156 const ids = hasReactions
157- ? (props.accounts! as Array<[FeedId, string]>).map(x => x[0])
157+ ? (props.accounts! as Array<[FeedId, string]>).map((x) => x[0])
158158 : (props.accounts! as Array<FeedId>);
159159
160160 return sources.ssb.liteAbout$(ids).map(
161- rawAbouts =>
161+ (rawAbouts) =>
162162 function propsReducer(prev: State): State {
163163 const abouts = hasReactions
164- ? rawAbouts.map(about => ({
164+ ? rawAbouts.map((about) => ({
165165 ...about,
166166 reaction: reactions.get(about.id),
167167 }))
168168 : rawAbouts;
src/frontend/screens/backup/index.tsView
@@ -123,9 +123,9 @@
123123 sources.screen.select('confirm-data').events('press'),
124124 )
125125 .mapTo([/* offset */ +1, /* animated */ true] as [number, boolean]);
126126
127- const vdom$ = sources.state.stream.map(state =>
127+ const vdom$ = sources.state.stream.map((state) =>
128128 h(View, {style: styles.screen}, [
129129 h(TopBar, {sel: 'topbar', title: t('backup.title')}),
130130
131131 tutorialPresentation('swiper', {scrollBy$}, [
@@ -211,9 +211,9 @@
211211 return {index: 0, isPortraitMode: true};
212212 });
213213
214214 const updateOrientationReducer$ = sources.orientation.map(
215- ori =>
215+ (ori) =>
216216 function updateOrientationReducer(prev: State): State {
217217 return {
218218 ...prev,
219219 isPortraitMode: ori === 'PORTRAIT' || ori === 'PORTRAIT-UPSIDEDOWN',
src/frontend/screens/biography/index.tsView
@@ -46,9 +46,9 @@
4646 )
4747 .mapTo({type: 'pop'} as Command);
4848
4949 const reducer$ = sources.props.map(
50- props =>
50+ (props) =>
5151 function propsReducer(): State {
5252 return props;
5353 },
5454 );
src/frontend/screens/biography/view.tsView
@@ -13,9 +13,9 @@
1313 import {State} from './index';
1414 import {styles} from './styles';
1515
1616 export default function view(state$: Stream<State>) {
17- return state$.map(state => {
17+ return state$.map((state) => {
1818 const windowDimensions = Dimensions.get('window');
1919 const windowWidth = windowDimensions.width;
2020
2121 return h(View, {style: styles.container}, [
src/frontend/screens/central/connections-tab/alert.tsView
@@ -22,9 +22,9 @@
2222 actions: Actions,
2323 state$: Stream<State>,
2424 ): Stream<AlertCommand> {
2525 return state$
26- .map(state =>
26+ .map((state) =>
2727 xs.merge(
2828 actions.showBluetoothHelp$.mapTo({
2929 title: t('connections.modes.bluetooth.title'),
3030 message:
src/frontend/screens/central/connections-tab/asyncstorage.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -20,13 +20,13 @@
2020
2121 export default function asyncStorage(state$: Stream<State>) {
2222 const command$ = state$
2323 .compose(dropRepeats((s1, s2) => s1.stagedPeers === s2.stagedPeers))
24- .filter(state => state.stagedPeers.some(isDhtInviteWithNote))
24+ .filter((state) => state.stagedPeers.some(isDhtInviteWithNote))
2525 .map((state: State) => {
2626 const keyValuePairs = state.stagedPeers
2727 .filter(isDhtInviteWithNote)
28- .map(kv => [noteStorageKeyFor(kv), kv[1].note]);
28+ .map((kv) => [noteStorageKeyFor(kv), kv[1].note]);
2929 return {type: 'multiSet', keyValuePairs} as Command;
3030 });
3131
3232 return command$;
src/frontend/screens/central/connections-tab/dialog.tsView
@@ -29,8 +29,8 @@
2929 },
3030 ),
3131 )
3232 .flatten()
33- .filter(res => res.action === 'actionPositive')
34- .map(res => (res as any).text as string),
33+ .filter((res) => res.action === 'actionPositive')
34+ .map((res) => (res as any).text as string),
3535 };
3636 }
src/frontend/screens/central/connections-tab/fab.tsView
@@ -14,9 +14,9 @@
1414 import {Dimensions} from '../../../global-styles/dimens';
1515 import {t} from '../../../drivers/localization';
1616
1717 export default function floatingAction(state$: Stream<State>): Stream<Props> {
18- return state$.map(state => {
18+ return state$.map((state) => {
1919 const visible = state.bluetoothEnabled || state.internetEnabled;
2020
2121 const actions: Array<IActionProps> = [];
2222 if (state.internetEnabled) {
src/frontend/screens/central/connections-tab/index.tsView
@@ -80,9 +80,9 @@
8080 const alert$ = alert(actionsPlus, sources.state.stream);
8181 const vdom$ = view(sources.state.stream);
8282
8383 const share$ = xs.merge(
84- actionsPlus.shareDhtInvite$.map(inviteCode => ({
84+ actionsPlus.shareDhtInvite$.map((inviteCode) => ({
8585 title: t('connections.share_code.p2p.title'),
8686 message: t('connections.share_code.p2p.message') + '\n\n' + inviteCode,
8787 dialogTitle: t('connections.share_code.p2p.dialog_note'),
8888 })),
@@ -96,9 +96,9 @@
9696 })),
9797 );
9898
9999 const inviteToast$: Stream<Toast> = sources.ssb.acceptInviteResponse$.map(
100- res => {
100+ (res) => {
101101 if (res === true)
102102 return {
103103 type: 'show' as 'show',
104104 flavor: 'success',
src/frontend/screens/central/connections-tab/intent.tsView
@@ -33,11 +33,11 @@
3333 return {
3434 //#region Header actions
3535
3636 pingConnectivityModes$: state$
37- .map(state => state.isVisible)
37+ .map((state) => state.isVisible)
3838 .compose(dropRepeats())
39- .map(isTabVisible =>
39+ .map((isTabVisible) =>
4040 isTabVisible
4141 ? concat(xs.of(0), xs.periodic(2000).take(2), xs.periodic(6000))
4242 : xs.never(),
4343 )
@@ -74,102 +74,102 @@
7474 .events('pressStaged')
7575 .filter((peer: StagedPeerKV) => peer[1].type === 'dht'),
7676
7777 goToPeerProfile$: menuChoice$
78- .filter(val => val === 'open-profile')
78+ .filter((val) => val === 'open-profile')
7979 .compose(sample(state$))
8080 .map(
81- state =>
81+ (state) =>
8282 (state.itemMenu.target as PeerKV | StagedPeerKV)[1].key as FeedId,
8383 ),
8484
8585 connectPeer$: menuChoice$
86- .filter(val => val === 'connect')
86+ .filter((val) => val === 'connect')
8787 .compose(sample(state$))
88- .map(state => state.itemMenu.target) as Stream<StagedPeerKV>,
88+ .map((state) => state.itemMenu.target) as Stream<StagedPeerKV>,
8989
9090 followConnectPeer$: menuChoice$
91- .filter(val => val === 'follow-connect')
91+ .filter((val) => val === 'follow-connect')
9292 .compose(sample(state$))
93- .map(state => state.itemMenu.target) as Stream<StagedPeerKV>,
93+ .map((state) => state.itemMenu.target) as Stream<StagedPeerKV>,
9494
9595 disconnectPeer$: menuChoice$
96- .filter(val => val === 'disconnect')
96+ .filter((val) => val === 'disconnect')
9797 .compose(sample(state$))
98- .map(state => (state.itemMenu.target as PeerKV)[0]),
98+ .map((state) => (state.itemMenu.target as PeerKV)[0]),
9999
100100 disconnectForgetPeer$: menuChoice$
101- .filter(val => val === 'disconnect-forget')
101+ .filter((val) => val === 'disconnect-forget')
102102 .compose(sample(state$))
103- .map(state => (state.itemMenu.target as PeerKV)[0]),
103+ .map((state) => (state.itemMenu.target as PeerKV)[0]),
104104
105105 forgetPeer$: menuChoice$
106- .filter(val => val === 'forget')
106+ .filter((val) => val === 'forget')
107107 .compose(sample(state$))
108- .map(state => (state.itemMenu.target as PeerKV)[0]),
108+ .map((state) => (state.itemMenu.target as PeerKV)[0]),
109109
110110 shareRoomInvite$: menuChoice$
111- .filter(val => val === 'room-share-invite')
111+ .filter((val) => val === 'room-share-invite')
112112 .compose(sample(state$))
113- .map(state => {
113+ .map((state) => {
114114 const peer = state.itemMenu.target as PeerKV;
115115 return {
116116 invite: roomUtils.addressToInvite(peer[0]),
117117 room: (peer[1].name as string) ?? peer[0],
118118 };
119119 }),
120120
121121 infoClientDhtInvite$: menuChoice$
122- .filter(val => val === 'invite-info')
122+ .filter((val) => val === 'invite-info')
123123 .compose(sample(state$))
124- .filter(state => state.itemMenu.target![1].role !== 'server')
124+ .filter((state) => state.itemMenu.target![1].role !== 'server')
125125 .mapTo(null),
126126
127127 infoServerDhtInvite$: menuChoice$
128- .filter(val => val === 'invite-info')
128+ .filter((val) => val === 'invite-info')
129129 .compose(sample(state$))
130- .filter(state => state.itemMenu.target![1].role === 'server')
130+ .filter((state) => state.itemMenu.target![1].role === 'server')
131131 .mapTo(null),
132132
133133 noteDhtInvite$: menuChoice$
134- .filter(val => val === 'invite-note')
134+ .filter((val) => val === 'invite-note')
135135 .mapTo(null),
136136
137137 shareDhtInvite$: menuChoice$
138- .filter(val => val === 'invite-share')
138+ .filter((val) => val === 'invite-share')
139139 .compose(sample(state$))
140140 .map(
141- state =>
141+ (state) =>
142142 'dht:' + state.itemMenu.target![1].key + ':' + state.selfFeedId,
143143 ),
144144
145145 removeDhtInvite$: menuChoice$
146- .filter(val => val === 'invite-delete')
146+ .filter((val) => val === 'invite-delete')
147147 .compose(sample(state$))
148- .map(state => state.itemMenu.target![1].key!),
148+ .map((state) => state.itemMenu.target![1].key!),
149149
150150 closeItemMenu$: xs
151151 .merge(
152- back$.compose(sample(state$)).filter(state => state.itemMenu.opened),
152+ back$.compose(sample(state$)).filter((state) => state.itemMenu.opened),
153153 reactSource.select('slide-in-menu').events('backdropPress'),
154154 )
155155 .mapTo(null),
156156
157157 goBack$: back$
158158 .compose(sample(state$))
159- .filter(state => !state.itemMenu.opened)
159+ .filter((state) => !state.itemMenu.opened)
160160 .mapTo(null),
161161
162162 //#endregion
163163
164164 //#region FAB actions
165165
166- goToPasteInvite$: fabPress$.filter(action => action === 'invite-paste'),
166+ goToPasteInvite$: fabPress$.filter((action) => action === 'invite-paste'),
167167
168- goToCreateInvite$: fabPress$.filter(action => action === 'invite-create'),
168+ goToCreateInvite$: fabPress$.filter((action) => action === 'invite-create'),
169169
170170 bluetoothSearch$: fabPress$
171- .filter(action => action === 'bluetooth-search')
171+ .filter((action) => action === 'bluetooth-search')
172172 .map(() =>
173173 xs.fromPromise(
174174 PermissionsAndroid.request(
175175 PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
src/frontend/screens/central/connections-tab/model.tsView
@@ -67,9 +67,9 @@
6767 factory: () => Stream<T>,
6868 ): Stream<T> {
6969 return appstate$
7070 .startWith('active')
71- .map(appstate => {
71+ .map((appstate) => {
7272 if (appstate === 'active') {
7373 return factory();
7474 } else {
7575 return xs.never() as Stream<T>;
@@ -104,9 +104,9 @@
104104 };
105105 });
106106
107107 const updateIsSyncing$ = ssbSource.isSyncing$.map(
108- isSyncing =>
108+ (isSyncing) =>
109109 function updateIsSyncing(prev: State): State {
110110 return {...prev, isSyncing};
111111 },
112112 );
@@ -117,9 +117,9 @@
117117 : actions.pingConnectivityModes$
118118 .map(() => networkSource.bluetoothIsEnabled())
119119 .flatten()
120120 .map(
121- bluetoothEnabled =>
121+ (bluetoothEnabled) =>
122122 function updateBluetoothEnabled(prev: State): State {
123123 return {...prev, bluetoothEnabled};
124124 },
125125 );
@@ -127,9 +127,9 @@
127127 const updateLanEnabled$ = actions.pingConnectivityModes$
128128 .map(() => networkSource.wifiIsEnabled())
129129 .flatten()
130130 .map(
131- lanEnabled =>
131+ (lanEnabled) =>
132132 function updateLanEnabled(prev: State): State {
133133 return {...prev, lanEnabled};
134134 },
135135 );
@@ -137,9 +137,9 @@
137137 const updateInternetEnabled$ = actions.pingConnectivityModes$
138138 .map(() => networkSource.hasInternetConnection())
139139 .flatten()
140140 .map(
141- internetEnabled =>
141+ (internetEnabled) =>
142142 function updateInternetEnabled(prev: State): State {
143143 return {...prev, internetEnabled};
144144 },
145145 );
@@ -154,9 +154,9 @@
154154 const setPeersReducer$ = onlyWhileAppIsInForeground(
155155 appstate$,
156156 () => ssbSource.peers$,
157157 ).map(
158- allPeers =>
158+ (allPeers) =>
159159 function setPeersReducer(prev: State): State {
160160 const peers = allPeers.filter(
161161 ([, data]) => (data.type as any) !== 'room',
162162 );
@@ -170,9 +170,9 @@
170170 const setStagedPeersReducer$ = onlyWhileAppIsInForeground(
171171 appstate$,
172172 () => ssbSource.stagedPeers$,
173173 )
174- .map(stagedPeers => {
174+ .map((stagedPeers) => {
175175 const dhtInvites = stagedPeers
176176 .filter(([_address, data]) => data.type === 'dht')
177177 .map(noteStorageKeyFor);
178178
@@ -181,27 +181,29 @@
181181 return xs.of([stagedPeers, notes]);
182182 } else {
183183 return asyncStorageSource
184184 .multiGet(dhtInvites)
185- .map(keyValuePairs => [stagedPeers, keyValuePairs]);
185+ .map((keyValuePairs) => [stagedPeers, keyValuePairs]);
186186 }
187187 })
188188 .flatten()
189189 .map(
190190 ([rawStagedPeers, notes]: [StagedPeerKV[], [string, string][]]) =>
191191 function setPeersReducer(prev: State): State {
192- const stagedPeers: Array<StagedPeerKV> = rawStagedPeers.map(peer => {
193- const key = peer[1].key;
194- const noteKV = notes.find(([k, v]) => k.endsWith(key) && !!v);
195- if (!noteKV) return peer;
196- return [peer[0], {...peer[1], note: noteKV[1]}] as StagedPeerKV;
197- });
192+ const stagedPeers: Array<StagedPeerKV> = rawStagedPeers.map(
193+ (peer) => {
194+ const key = peer[1].key;
195+ const noteKV = notes.find(([k, v]) => k.endsWith(key) && !!v);
196+ if (!noteKV) return peer;
197+ return [peer[0], {...peer[1], note: noteKV[1]}] as StagedPeerKV;
198+ },
199+ );
198200 return {...prev, stagedPeers, timestampStagedPeers: Date.now()};
199201 },
200202 );
201203
202204 const openConnMenuReducer$ = actions.openPeerInConnection$.map(
203- peer =>
205+ (peer) =>
204206 function openConnMenuReducer(prev: State): State {
205207 return {
206208 ...prev,
207209 itemMenu: {
@@ -213,9 +215,9 @@
213215 },
214216 );
215217
216218 const openStagingMenuReducer$ = actions.openStagedPeer$.map(
217- peer =>
219+ (peer) =>
218220 function openStagingMenuReducer(prev: State): State {
219221 return {
220222 ...prev,
221223 itemMenu: {
@@ -228,9 +230,9 @@
228230 },
229231 );
230232
231233 const openRoomMenuReducer$ = actions.openRoom$.map(
232- peer =>
234+ (peer) =>
233235 function openRoomMenuReducer(prev: State): State {
234236 return {
235237 ...prev,
236238 itemMenu: {
@@ -242,9 +244,9 @@
242244 },
243245 );
244246
245247 const openInviteMenuReducer$ = actions.openDHTStagedPeer$.map(
246- peer =>
248+ (peer) =>
247249 function openInviteMenuReducer(prev: State): State {
248250 return {
249251 ...prev,
250252 itemMenu: {
@@ -280,12 +282,12 @@
280282 };
281283 });
282284
283285 const addNoteFromDialogReducer$ = actions.addNoteFromDialog$.map(
284- note =>
286+ (note) =>
285287 function addNoteFromDialogReducer(prev: State): State {
286288 if (!prev.latestInviteMenuTarget) return prev;
287- const stagedPeers: Array<StagedPeerKV> = prev.stagedPeers.map(kv => {
289+ const stagedPeers: Array<StagedPeerKV> = prev.stagedPeers.map((kv) => {
288290 const [addr, peer] = kv;
289291 return peer.key === prev.latestInviteMenuTarget![1].key
290292 ? ([addr, {...peer, note}] as StagedPeerKV)
291293 : kv;
src/frontend/screens/central/connections-tab/ssb.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -21,34 +21,36 @@
2121
2222 export default function ssb(actions: Actions) {
2323 return xs.merge(
2424 actions.removeDhtInvite$.map(
25- invite => ({type: 'dhtInvite.remove', invite} as Req),
25+ (invite) => ({type: 'dhtInvite.remove', invite} as Req),
2626 ),
2727 actions.connectPeer$.map(
28- peer =>
28+ (peer) =>
2929 ({
3030 type: 'conn.connect',
3131 address: peer[0],
3232 hubData: {type: peer[1].type},
3333 } as Req),
3434 ),
3535 actions.followConnectPeer$.map(
36- peer =>
36+ (peer) =>
3737 ({
3838 type: 'conn.followConnect',
3939 address: peer[0],
4040 key: peer[1].key,
4141 hubData: {type: peer[1].type},
4242 } as Req),
4343 ),
4444 actions.disconnectPeer$.map(
45- address => ({type: 'conn.disconnect', address} as Req),
45+ (address) => ({type: 'conn.disconnect', address} as Req),
4646 ),
4747 actions.disconnectForgetPeer$.map(
48- address => ({type: 'conn.disconnectForget', address} as Req),
48+ (address) => ({type: 'conn.disconnectForget', address} as Req),
4949 ),
50- actions.forgetPeer$.map(address => ({type: 'conn.forget', address} as Req)),
50+ actions.forgetPeer$.map(
51+ (address) => ({type: 'conn.forget', address} as Req),
52+ ),
5153 actions.bluetoothSearch$.mapTo({
5254 type: 'bluetooth.search',
5355 interval: 20e3,
5456 } as Req),
src/frontend/screens/central/connections-tab/view/Body/PopList.tsView
@@ -164,9 +164,9 @@
164164 return 0;
165165 });
166166 }
167167
168-const DEFAULT_DURATION = 250 /* ms */;
168+const DEFAULT_DURATION = 250; /* ms */
169169
170170 export default class PopList<T> extends PureComponent<Props<T>, State<T>> {
171171 constructor(props: Props<T>) {
172172 super(props);
@@ -178,10 +178,10 @@
178178 }
179179
180180 private noDifference(prevProps: Props<T>, nextProps: Props<T>): boolean {
181181 // TODO make this faster
182- const prevData = prevProps.data.map(x => [0, x, 0]) as State<T>['data'];
183- const nextData = nextProps.data.map(x => [0, x, 0]) as State<T>['data'];
182+ const prevData = prevProps.data.map((x) => [0, x, 0]) as State<T>['data'];
183+ const nextData = nextProps.data.map((x) => [0, x, 0]) as State<T>['data'];
184184 const prevCode = sortByKey<T>(prevData)
185185 .map(([_key, item]) => JSON.stringify(item))
186186 .join();
187187 const nextCode = sortByKey(nextData)
src/frontend/screens/central/connections-tab/view/SlideInMenu.tsView
@@ -34,11 +34,13 @@
3434 | 'invite-note'
3535 | 'invite-share'
3636 | 'invite-delete';
3737
38-const MenuOption: React.ComponentClass<MenuOptionProps & {
39- value: MenuChoice;
40-}> = _MenuOption as any;
38+const MenuOption: React.ComponentClass<
39+ MenuOptionProps & {
40+ value: MenuChoice;
41+ }
42+> = _MenuOption as any;
4143
4244 type MenuOptionContentProps = {
4345 icon: string;
4446 text: string;
src/frontend/screens/central/connections-tab/view/index.tsView
@@ -15,9 +15,9 @@
1515 import SlideInMenu from './SlideInMenu';
1616
1717 export default function view(state$: Stream<State>) {
1818 return state$
19- .filter(state => state.isVisible)
19+ .filter((state) => state.isVisible)
2020 .compose(
2121 dropRepeatsByKeys([
2222 'bluetoothEnabled',
2323 'bluetoothLastScanned',
@@ -27,9 +27,9 @@
2727 'timestampStagedPeers',
2828 'itemMenu',
2929 ]),
3030 )
31- .map(state => {
31+ .map((state) => {
3232 return h(
3333 ScrollView,
3434 {
3535 style: styles.container,
src/frontend/screens/central/private-tab/fab.tsView
@@ -12,9 +12,9 @@
1212 import {t} from '../../../drivers/localization';
1313
1414 export default function floatingAction(state$: Stream<State>): Stream<Props> {
1515 return state$.map(
16- state =>
16+ (state) =>
1717 ({
1818 sel: 'fab',
1919 color: Palette.backgroundCTA,
2020 visible: !!state.getPrivateFeedReadable,
src/frontend/screens/central/private-tab/intent.tsView
@@ -13,9 +13,9 @@
1313 fabPress$: Stream<string>,
1414 ) {
1515 return {
1616 goToRecipientsInput$: fabPress$
17- .filter(action => action === 'recipients-input')
17+ .filter((action) => action === 'recipients-input')
1818 .mapTo(null),
1919
2020 goToConversation$: reactSource
2121 .select('conversationList')
src/frontend/screens/central/private-tab/navigation.tsView
@@ -47,9 +47,9 @@
4747
4848 const toRecipientsInput$ = actions.goToRecipientsInput$
4949 .compose(sample(state$))
5050 .map(
51- state =>
51+ (state) =>
5252 ({
5353 type: 'push',
5454 layout: {
5555 component: {
src/frontend/screens/central/private-tab/view.tsView
@@ -118,9 +118,9 @@
118118 style: isUnread
119119 ? styles.conversationAuthorsUnread
120120 : styles.conversationAuthors,
121121 },
122- recps.map(x => displayName(x.name, x.id)).join(', '),
122+ recps.map((x) => displayName(x.name, x.id)).join(', '),
123123 ),
124124 ]),
125125 ]),
126126 ],
@@ -203,13 +203,13 @@
203203 // The first state passes regardless if the screen is visible (the purpose is
204204 // to populate the ConversationList with data ASAP), but the subsequent state
205205 // emissions are guarded by the visibility check.
206206 const viewState$ = concat(
207- state$.filter(state => !!state.getPrivateFeedReadable).take(1),
208- state$.filter(state => state.isVisible),
207+ state$.filter((state) => !!state.getPrivateFeedReadable).take(1),
208+ state$.filter((state) => state.isVisible),
209209 ).compose(dropRepeatsByKeys(['updatesFlag', 'getPrivateFeedReadable']));
210210
211- const vdom$ = viewState$.map(state => {
211+ const vdom$ = viewState$.map((state) => {
212212 return h(ConversationsList, {
213213 sel: 'conversationList',
214214 unreadSet: state.updates,
215215 forceRefresh$,
src/frontend/screens/central/public-tab/fab.tsView
@@ -12,9 +12,9 @@
1212 import {t} from '../../../drivers/localization';
1313
1414 export default function floatingAction(state$: Stream<State>): Stream<Props> {
1515 return state$.map(
16- state =>
16+ (state) =>
1717 ({
1818 sel: 'fab',
1919 color: state.hasComposeDraft
2020 ? Palette.backgroundWarningAction
src/frontend/screens/central/public-tab/intent.tsView
@@ -28,9 +28,9 @@
2828 .select('publicFeed')
2929 .events('refresh') as Stream<any>;
3030
3131 return {
32- goToCompose$: fabPress$.filter(action => action === 'compose'),
32+ goToCompose$: fabPress$.filter((action) => action === 'compose'),
3333
3434 goToAccounts$: (reactSource
3535 .select('publicFeed')
3636 .events('pressReactions') as Stream<PressReactionsEvent>).map(
src/frontend/screens/central/public-tab/navigation.tsView
@@ -41,9 +41,9 @@
4141 actions: Actions,
4242 state$: Stream<State>,
4343 ): Stream<Command> {
4444 const toCompose$ = actions.goToCompose$.compose(sample(state$)).map(
45- state =>
45+ (state) =>
4646 ({
4747 type: 'push',
4848 layout: {
4949 component: {
@@ -134,9 +134,9 @@
134134 } as Command),
135135 );
136136
137137 const toRawMsg$ = actions.goToRawMsg$.map(
138- msg =>
138+ (msg) =>
139139 ({
140140 type: 'push',
141141 layout: {
142142 component: {
src/frontend/screens/central/top-bar/index.tsView
@@ -123,9 +123,9 @@
123123 const opaque = new Animated.Value(1);
124124 let hideYWhenScrolling: Animated.AnimatedMultiplication | null = null;
125125 let hideOpacityWhenScrolling: Animated.AnimatedMultiplication | null = null;
126126
127- return state$.map(state => {
127+ return state$.map((state) => {
128128 // Avoid re-instantiating a new animated value on every stream emission
129129 if (!hideYWhenScrolling) {
130130 hideYWhenScrolling = calcTranslateY(state.scrollHeaderBy);
131131 }
src/frontend/screens/central/view.tsView
@@ -185,9 +185,9 @@
185185 isSelected: boolean;
186186 details: State['connectionsTab'];
187187 }> {
188188 private static countConnected(d: ConnectionsTabIcon['props']['details']) {
189- return (d?.peers ?? []).filter(p => p[1].state === 'connected').length;
189+ return (d?.peers ?? []).filter((p) => p[1].state === 'connected').length;
190190 }
191191
192192 private static countStaged(d: ConnectionsTabIcon['props']['details']) {
193193 return (d?.stagedPeers ?? []).length;
src/frontend/screens/compose/asyncstorage.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -21,9 +21,9 @@
2121 export default function asyncStorage(actions: Actions, state$: Stream<State>) {
2222 const savePostDraft$ = actions.exitSavingPostDraft$
2323 .compose(sample(state$))
2424 .map(
25- state =>
25+ (state) =>
2626 ({
2727 type: 'setItem',
2828 key: 'composeDraft',
2929 value: state.postText,
@@ -44,9 +44,9 @@
4444 } as Command),
4545 );
4646
4747 const saveReplyDraft$ = actions.exitReply$.compose(sample(state$)).map(
48- state =>
48+ (state) =>
4949 ({
5050 type: 'setItem',
5151 key: `replyDraft:${state.root}`,
5252 value: state.postText,
@@ -55,9 +55,9 @@
5555
5656 const deleteReplyDraft$ = actions.publishReply$
5757 .compose(sample(state$))
5858 .map(
59- state =>
59+ (state) =>
6060 ({type: 'removeItem', key: `replyDraft:${state.root}`} as Command),
6161 );
6262
6363 return xs.merge(
src/frontend/screens/compose/dialog.tsView
@@ -31,13 +31,13 @@
3131 },
3232 ),
3333 )
3434 .flatten()
35- .filter(res => res.action === 'actionPositive')
36- .map(res => (res as any).text as string),
35+ .filter((res) => res.action === 'actionPositive')
36+ .map((res) => (res as any).text as string),
3737
3838 addPictureWithCaption$: actions.addPicture$
39- .map(image =>
39+ .map((image) =>
4040 dialogSource
4141 .prompt(
4242 t('compose.dialogs.image_caption.title'),
4343 t('compose.dialogs.image_caption.description'),
@@ -46,9 +46,9 @@
4646 positiveColor: Palette.text,
4747 positiveText: t('call_to_action.done'),
4848 },
4949 )
50- .map(res => ({caption: (res as any).text, image})),
50+ .map((res) => ({caption: (res as any).text, image})),
5151 )
5252 .flatten(),
5353 };
5454 }
src/frontend/screens/compose/intent.tsView
@@ -92,14 +92,16 @@
9292 updateSelection$: Platform.select({
9393 // TextInput Selection events that happen after focus and before blur
9494 ios: selectionChange$
9595 .compose(between(focusInput$, blurInput$))
96- .map(ev => ev.nativeEvent.selection),
96+ .map((ev) => ev.nativeEvent.selection),
9797
9898 // TextInput Selection events, but ignore the first event caused by a focus
9999 default: focusInput$
100100 .startWith('initial focus')
101- .map(() => selectionChange$.drop(1).map(ev => ev.nativeEvent.selection))
101+ .map(() =>
102+ selectionChange$.drop(1).map((ev) => ev.nativeEvent.selection),
103+ )
102104 .flatten(),
103105 }),
104106
105107 chooseMention$: reactSource
@@ -156,13 +158,13 @@
156158
157159 exitReply$: backReply$,
158160
159161 exitSavingPostDraft$: backPostWithDialog$.filter(
160- res => res.action === 'actionPositive',
162+ (res) => res.action === 'actionPositive',
161163 ),
162164
163165 exitDeletingPostDraft$: backPostWithDialog$.filter(
164- res => res.action === 'actionNegative',
166+ (res) => res.action === 'actionNegative',
165167 ),
166168
167169 exitOfAnyKind$: xs.merge(
168170 publishPost$,
src/frontend/screens/compose/model.tsView
@@ -87,9 +87,9 @@
8787 asyncStorageSource: AsyncStorageSource,
8888 ssbSource: SSBSource,
8989 ): Stream<Reducer<State>> {
9090 const propsReducer$ = props$.take(1).map(
91- props =>
91+ (props) =>
9292 function propsReducer(): State {
9393 return {
9494 postText: props.text ?? '',
9595 postTextSelection: props.text
@@ -109,9 +109,9 @@
109109 },
110110 );
111111
112112 const updateSelectionReducer$ = actions.updateSelection$.map(
113- postTextSelection =>
113+ (postTextSelection) =>
114114 function updateCursorPositionReducer(prev: State): State {
115115 // If the mention TextInput is open, dont update the postText selection
116116 if (prev.mentionQuery) {
117117 return prev;
@@ -121,9 +121,9 @@
121121 },
122122 );
123123
124124 const updatePostTextReducer$ = actions.updatePostText$.map(
125- postText =>
125+ (postText) =>
126126 function updatePostTextReducer(prev: State): State {
127127 return {...prev, postText};
128128 },
129129 );
@@ -137,9 +137,9 @@
137137
138138 return ssbSource
139139 .getMentionSuggestions(mentionQuery, state.authors)
140140 .map(
141- suggestions =>
141+ (suggestions) =>
142142 [suggestions, selection] as [Array<MentionSuggestion>, Selection],
143143 );
144144 })
145145 .flatten()
@@ -171,9 +171,9 @@
171171 },
172172 );
173173
174174 const updateMentionQueryReducer$ = actions.updateMentionQuery$.map(
175- mentionQuery =>
175+ (mentionQuery) =>
176176 function updateMentionQueryReducer(prev: State): State {
177177 if (mentionQuery.length) {
178178 return {...prev, mentionQuery};
179179 } else {
@@ -182,25 +182,25 @@
182182 },
183183 );
184184
185185 const updateMentionSuggestionsReducer2$ = actions.updateMentionQuery$
186- .map(query => query.replace(/^@+/g, ''))
186+ .map((query) => query.replace(/^@+/g, ''))
187187 .compose(sampleCombine(state$))
188188 .map(([mentionQuery, state]) =>
189189 !mentionQuery
190190 ? xs.never()
191191 : ssbSource.getMentionSuggestions(mentionQuery, state.authors),
192192 )
193193 .flatten()
194194 .map(
195- mentionSuggestions =>
195+ (mentionSuggestions) =>
196196 function updateMentionSuggestionsReducer2(prev: State): State {
197197 return {...prev, mentionSuggestions};
198198 },
199199 );
200200
201201 const chooseMentionReducer$ = actions.chooseMention$.map(
202- chosen =>
202+ (chosen) =>
203203 function chooseMentionReducer(prev: State): State {
204204 const cursor = prev.postTextSelection.start;
205205 const preMention = prev.postText.substr(0, cursor);
206206 const postMention = prev.postText.substr(cursor);
@@ -245,9 +245,9 @@
245245
246246 const addPictureReducer$ = actions.addPictureWithCaption$
247247 .map(({caption, image}) =>
248248 ssbSource.addBlobFromPath$(image.path.replace('file://', '')).map(
249- blobId =>
249+ (blobId) =>
250250 function addPictureReducer(prev: State): State {
251251 let separator = '';
252252 if (prev.postText.trim().length > 0) {
253253 // Count how many new lines are already at the end of the postText
@@ -271,9 +271,9 @@
271271 )
272272 .flatten();
273273
274274 const updateContentWarningReducer$ = actions.updateContentWarning$.map(
275- contentWarning =>
275+ (contentWarning) =>
276276 function updateContentWarningReducer(prev: State): State {
277277 return {...prev, contentWarning};
278278 },
279279 );
@@ -285,11 +285,11 @@
285285 );
286286
287287 const getComposeDraftReducer$ = asyncStorageSource
288288 .getItem('composeDraft')
289- .filter(str => !!str)
289+ .filter((str) => !!str)
290290 .map(
291- composeDraft =>
291+ (composeDraft) =>
292292 function getComposeDraftReducer(prev: State): State {
293293 if (prev.root) {
294294 return prev;
295295 } else {
src/frontend/screens/compose/top-bar/index.tsView
@@ -84,9 +84,9 @@
8484 };
8585 }
8686
8787 function view(state$: Stream<State>) {
88- return state$.map(state =>
88+ return state$.map((state) =>
8989 h(View, {style: styles.container}, [
9090 h(HeaderButton, {
9191 sel: 'composeCloseButton',
9292 icon: state.isReply ? 'arrow-collapse' : 'close',
src/frontend/screens/compose/view.tsView
@@ -235,9 +235,9 @@
235235 mentionChoiceTimestamp: 0,
236236 });
237237
238238 const mentionQueryPairwise$ = miniState$
239- .map(s => s.mentionQuery)
239+ .map((s) => s.mentionQuery)
240240 .compose(pairwise);
241241
242242 const focusMarkdownInput$ = mentionQueryPairwise$
243243 .filter(([prev, curr]) => !!prev && !curr)
src/frontend/screens/conversation/intent.tsView
@@ -14,9 +14,9 @@
1414 return {
1515 publishMsg$: reactSource
1616 .select('chat')
1717 .events('send')
18- .map(arr => arr[0].text),
18+ .map((arr) => arr[0].text),
1919
2020 goBack$: xs.merge(
2121 navSource.backPress(),
2222 reactSource.select('topbar').events('pressBack'),
src/frontend/screens/conversation/model.tsView
@@ -52,9 +52,9 @@
5252 props$: Stream<Props>,
5353 ssbSource: SSBSource,
5454 ): Stream<Reducer<State>> {
5555 const propsReducer$ = props$.take(1).map(
56- props =>
56+ (props) =>
5757 function propsReducer(_prev?: State): State {
5858 if (props.rootMsgId) {
5959 return {
6060 selfFeedId: props.selfFeedId,
@@ -85,27 +85,27 @@
8585 .merge(
8686 // Load an existing private thread
8787 props$
8888 .take(1)
89- .map(props => props.rootMsgId)
90- .filter(rootMsgId => !!rootMsgId),
89+ .map((props) => props.rootMsgId)
90+ .filter((rootMsgId) => !!rootMsgId),
9191
9292 // Wait for self to publish a new private thread root
9393 props$
94- .map(props => props.recps)
95- .filter(recps => !!recps)
94+ .map((props) => props.recps)
95+ .filter((recps) => !!recps)
9696 .take(1)
9797 .map(() => ssbSource.selfPrivateRoots$)
9898 .flatten()
99- .map(msg => msg.key)
99+ .map((msg) => msg.key)
100100 .take(1),
101101 )
102102 .compose(dropCompletion)
103103 .remember() as Stream<MsgId>;
104104
105105 const loadExistingThreadReducer$ = rootMsgId$
106- .map(rootMsgId =>
107- ssbSource.thread$(rootMsgId, true).replaceError(err => {
106+ .map((rootMsgId) =>
107+ ssbSource.thread$(rootMsgId, true).replaceError((err) => {
108108 if (/Author Blocked/i.test(err.message)) return xs.of(blockedThread);
109109 if (/Not Found/i.test(err.message)) return xs.of(missingThread);
110110 else return xs.of(unknownErrorThread);
111111 }),
@@ -122,12 +122,12 @@
122122 },
123123 );
124124
125125 const updateWithLiveRepliesReducer$ = rootMsgId$
126- .map(rootMsgId => ssbSource.threadUpdates$(rootMsgId, true))
126+ .map((rootMsgId) => ssbSource.threadUpdates$(rootMsgId, true))
127127 .flatten()
128128 .map(
129- newMsg =>
129+ (newMsg) =>
130130 function updateWithLiveRepliesReducer(prev: State): State {
131131 return {
132132 ...prev,
133133 thread: {
src/frontend/screens/conversation/ssb.tsView
@@ -19,9 +19,9 @@
1919 function createReplyContent(text: string, state: State): PostContent {
2020 const messages = state.thread.messages;
2121 const branch = messages[messages.length - 1].key;
2222 const content = toReplyPostContent({text, root: state.rootMsgId!, branch});
23- content.recps = state.thread.recps.map(recp => recp.id);
23+ content.recps = state.thread.recps.map((recp) => recp.id);
2424 return content;
2525 }
2626
2727 function createRootContent(text: string, state: State): PostContent {
@@ -35,9 +35,9 @@
3535 ' recipients',
3636 );
3737 }
3838 const content = toPostContent(text);
39- content.recps = state.thread.recps.map(recp => recp.id);
39+ content.recps = state.thread.recps.map((recp) => recp.id);
4040 if (!content.recps.includes(state.selfFeedId)) {
4141 content.recps.push(state.selfFeedId);
4242 }
4343 return content;
src/frontend/screens/conversation/view.tsView
@@ -230,13 +230,13 @@
230230 dropRepeatsByKeys([
231231 'avatarUrl',
232232 'rootMsgId',
233233 'selfFeedId',
234- s => s.thread.messages.length,
235- s => s.thread.full,
234+ (s) => s.thread.messages.length,
235+ (s) => s.thread.full,
236236 ]),
237237 )
238- .map(state => {
238+ .map((state) => {
239239 const sysMessages: Array<GiftedMsg> = state.emptyThreadSysMessage
240240 ? [
241241 {
242242 _id: 1,
src/frontend/screens/drawer/intent.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -7,25 +7,13 @@
77 import {ReactSource} from '@cycle/react';
88
99 export default function intent(source: ReactSource) {
1010 return {
11- goToSelfProfile$: source
12- .select('self-profile')
13- .events('press')
14- .mapTo(null),
11+ goToSelfProfile$: source.select('self-profile').events('press').mapTo(null),
1512
16- emailBugReport$: source
17- .select('bug-report')
18- .events('press')
19- .mapTo(null),
13+ emailBugReport$: source.select('bug-report').events('press').mapTo(null),
2014
21- goToSettings$: source
22- .select('settings')
23- .events('press')
24- .mapTo(null),
15+ goToSettings$: source.select('settings').events('press').mapTo(null),
2516
26- showRawDatabase$: source
27- .select('raw-db')
28- .events('press')
29- .mapTo(null),
17+ showRawDatabase$: source.select('raw-db').events('press').mapTo(null),
3018 };
3119 }
src/frontend/screens/drawer/model.tsView
@@ -17,12 +17,12 @@
1717
1818 export default function model(ssbSource: SSBSource): Stream<Reducer<State>> {
1919 const initAboutReducer$ = ssbSource.selfFeedId$
2020 .take(1)
21- .map(selfFeedId => ssbSource.profileAboutLive$(selfFeedId))
21+ .map((selfFeedId) => ssbSource.profileAboutLive$(selfFeedId))
2222 .flatten()
2323 .map(
24- about =>
24+ (about) =>
2525 function initAboutReducer(prev: State): State {
2626 const id = about.id;
2727 let name = '';
2828 if (!!about.name && about.name !== id) {
src/frontend/screens/drawer/navigation.tsView
@@ -24,9 +24,9 @@
2424 actions: Actions,
2525 state$: Stream<State>,
2626 ): Stream<Command> {
2727 const toSelfProfile$ = actions.goToSelfProfile$.compose(sample(state$)).map(
28- state =>
28+ (state) =>
2929 ({
3030 type: 'push',
3131 id: 'mainstack',
3232 layout: {
@@ -72,9 +72,9 @@
7272 );
7373
7474 const hideDrawerAndPush$ = xs
7575 .merge(toSelfProfile$, toRawDatabase$, toSettings$)
76- .map(pushCommand => {
76+ .map((pushCommand) => {
7777 const hideDrawer: Command = {
7878 type: 'mergeOptions',
7979 opts: {
8080 sideMenu: {
src/frontend/screens/drawer/view.tsView
@@ -78,9 +78,9 @@
7878 }
7979 }
8080
8181 export default function view(state$: Stream<State>): Stream<ReactElement<any>> {
82- return state$.map(state =>
82+ return state$.map((state) =>
8383 h(View, {style: styles.container}, [
8484 h(View, {style: styles.header}, [
8585 h(Avatar, {
8686 style: styles.authorImage,
src/frontend/screens/global/localization.tsView
@@ -15,9 +15,9 @@
1515 Platform.OS === 'android'
1616 ? fsSource.readDirAssets('translations')
1717 : fsSource.readDir(FSSource.MainBundlePath + '/translations');
1818
19- const translationPaths$ = translationsDir$.map(translationsDir =>
19+ const translationPaths$ = translationsDir$.map((translationsDir) =>
2020 translationsDir
2121 .filter(({isFile, name}) => isFile() && name.endsWith('.json'))
2222 .reduce((all, {name, path}) => {
2323 const languageTag = name.replace('.json', '');
@@ -28,17 +28,17 @@
2828 const readFile =
2929 Platform.OS === 'android' ? fsSource.readFileAssets : fsSource.readFile;
3030
3131 const command$: Stream<LocalizationCmd> = translationPaths$
32- .map(translationPaths => {
32+ .map((translationPaths) => {
3333 const fallbackLanguageTag = 'en';
3434
3535 const fallbackFileContent$ = readFile(
3636 translationPaths[fallbackLanguageTag],
3737 'utf8',
3838 );
3939
40- return fallbackFileContent$.map(fallbackFileContent => ({
40+ return fallbackFileContent$.map((fallbackFileContent) => ({
4141 translationPaths,
4242 fallbackLanguageTag,
4343 fallbackFileContent,
4444 }));
@@ -63,9 +63,9 @@
6363 translationPaths[bestLanguageTag],
6464 'utf8',
6565 );
6666
67- return bestFileContent$.map(bestFileContent => {
67+ return bestFileContent$.map((bestFileContent) => {
6868 return {
6969 locale: bestLanguageTag,
7070 defaultLocale: fallbackLanguageTag,
7171 translations: {
src/frontend/screens/invite-create/index.tsView
@@ -66,9 +66,9 @@
6666 const share$ = sources.screen
6767 .select('inviteShareButton')
6868 .events('press')
6969 .compose(sample(sources.state.stream))
70- .map(state => ({
70+ .map((state) => ({
7171 title: t('connections.share_code.p2p.title'),
7272 message:
7373 t('connections.share_code.p2p.message') + '\n\n' + state.inviteCode,
7474 dialogTitle: t('connections.share_code.p2p.dialog_note'),
src/frontend/screens/invite-create/model.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -18,9 +18,9 @@
1818 return {inviteCode: null};
1919 });
2020
2121 const createInviteCodeReducer$ = ssbSource.createDhtInvite$().map(
22- inviteCode =>
22+ (inviteCode) =>
2323 function createInviteCodeReducer(prev?: State): State {
2424 return {inviteCode};
2525 },
2626 );
src/frontend/screens/invite-create/view.tsView
@@ -18,9 +18,9 @@
1818 return h(Text, {style: styles.bold}, innerText);
1919 }
2020
2121 export default function view(state$: Stream<State>) {
22- return state$.map(state =>
22+ return state$.map((state) =>
2323 h(View, {style: styles.container}, [
2424 h(TopBar, {sel: 'topbar'}, [
2525 h(HeaderButton, {
2626 sel: 'inviteShareButton',
src/frontend/screens/invite-paste/intent.tsView
@@ -1,5 +1,5 @@
1-/* Copyright (C) 2018-2019 The Manyverse Authors.
1+/* Copyright (C) 2018-2020 The Manyverse Authors.
22 *
33 * This Source Code Form is subject to the terms of the Mozilla Public
44 * License, v. 2.0. If a copy of the MPL was not distributed with this
55 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -21,34 +21,34 @@
2121 state$: Stream<State>,
2222 keyboardSource: KeyboardSource,
2323 lifecycle$: Stream<LifecycleEvent>,
2424 ) {
25- const activityPaused$ = lifecycle$.filter(ev => ev === 'paused');
26- const activityResumed$ = lifecycle$.filter(ev => ev === 'resumed');
25+ const activityPaused$ = lifecycle$.filter((ev) => ev === 'paused');
26+ const activityResumed$ = lifecycle$.filter((ev) => ev === 'resumed');
2727 const composeAppeared$ = navSource.didAppear();
2828 const composeDisappearing$ = navSource.didDisappear();
2929
3030 const done$ = reactSource
3131 .select('inviteAcceptButton')
3232 .events('press')
3333 .compose(sample(state$))
34- .map(state => state.content)
35- .filter(text => text.length > 0);
34+ .map((state) => state.content)
35+ .filter((text) => text.length > 0);
3636
3737 return {
3838 back$: xs.merge(
3939 navSource.backPress(),
4040 reactSource.select('topbar').events('pressBack'),
4141 ),
4242
43- dhtDone$: done$.filter(text => text.startsWith('dht:')),
43+ dhtDone$: done$.filter((text) => text.startsWith('dht:')),
4444
4545 roomDone$: done$.filter(
46- text => !text.startsWith('dht:') && roomUtils.isInvite(text),
46+ (text) => !text.startsWith('dht:') && roomUtils.isInvite(text),
4747 ),
4848
4949 normalDone$: done$.filter(
50- text => !text.startsWith('dht:') && !roomUtils.isInvite(text),
50+ (text) => !text.startsWith('dht:') && !roomUtils.isInvite(text),
5151 ),
5252
5353 updateContent$: reactSource
5454 .select('contentInput')