Skip to content

Commit 971ecdd

Browse files
committed
import: Work around broken imports of '.'.
A bug somewhere in our stack -- presumably Metro or one of its dependencies -- means that in src/notification/notificationActions.js the import from `.` was getting resolved not to the module built from its neighboring `index.js` file, as it should… but to the module corresponding to the directory `src/common/`. That also happens to be the directory where our only other imports from `.` are found. Seems like the bug may involve the resolution of `.` being inappropriately shared globally. In any case, the bug goes away when we make the import reference a little less special-looking, as `./`. Thread: https://chat.zulip.org/#narrow/stream/48-mobile/topic/Notification.20Crash/near/1215247 Fixes: #4818
1 parent 2700c41 commit 971ecdd

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/common/CountOverlay.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import React, { PureComponent } from 'react';
44
import { View } from 'react-native';
55

6-
import { ComponentWithOverlay, UnreadCount } from '.';
6+
// eslint-disable-next-line import/no-useless-path-segments
7+
import { ComponentWithOverlay, UnreadCount } from './'; // Like '.'; see #4818.
78
import { BRAND_COLOR, createStyleSheet } from '../styles';
89

910
const styles = createStyleSheet({

src/common/FullScreenLoading.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { View } from 'react-native';
44
import { useSafeAreaInsets } from 'react-native-safe-area-context';
55

66
import { BRAND_COLOR, createStyleSheet } from '../styles';
7-
import { LoadingIndicator, ZulipStatusBar } from '.';
7+
// eslint-disable-next-line import/no-useless-path-segments
8+
import { LoadingIndicator, ZulipStatusBar } from './'; // Like '.'; see #4818.
89

910
const componentStyles = createStyleSheet({
1011
center: {

src/common/LoadingBanner.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { View } from 'react-native';
66
import type { Dispatch } from '../types';
77
import { connect } from '../react-redux';
88
import { getLoading } from '../selectors';
9-
import { Label, LoadingIndicator } from '.';
9+
// eslint-disable-next-line import/no-useless-path-segments
10+
import { Label, LoadingIndicator } from './'; // Like '.'; see #4818.
1011
import type { ThemeData } from '../styles';
1112
import { ThemeContext, createStyleSheet } from '../styles';
1213

src/common/ZulipTextButton.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { View } from 'react-native';
44

55
import type { LocalizableText } from '../types';
66
import { BRAND_COLOR, createStyleSheet } from '../styles';
7-
import { Label } from '.';
7+
// eslint-disable-next-line import/no-useless-path-segments
8+
import { Label } from './'; // Like '.'; see #4818.
89
import Touchable from './Touchable';
910

1011
// When adding a variant, take care that it's legitimate, it addresses a

src/notification/notificationActions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
tryStopNotifications as innerStopNotifications,
99
getNarrowFromNotificationData,
1010
getAccountFromNotificationData,
11-
} from '.';
11+
// eslint-disable-next-line import/no-useless-path-segments
12+
} from './'; // Like '.'; see #4818.
1213
import type { Notification } from './types';
1314
import { getAuth, getActiveAccount } from '../selectors';
1415
import { getSession, getAccounts } from '../directSelectors';

0 commit comments

Comments
 (0)