Skip to content

Commit 18fa642

Browse files
chrisbobbegnprice
authored andcommitted
messagesActions [nfc]: Add globalSettings variable in messageLinkPress
1 parent 9e8a0d0 commit 18fa642

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/message/messagesActions.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export const messageLinkPress =
229229
const streamsById = getStreamsById(state);
230230
const streamsByName = getStreamsByName(state);
231231
const ownUserId = getOwnUserId(state);
232+
const globalSettings = getGlobalSettings();
232233

233234
const parsedUrl = tryParseUrl(href, auth.realm);
234235
if (!parsedUrl) {
@@ -252,7 +253,7 @@ export const messageLinkPress =
252253
// …Could also be an invalid narrow link, or one that we *could*
253254
// parse but just haven't (e.g., operands in an unexpected order).
254255
// Opening the browser won't be ideal in those cases.
255-
openLinkWithUserPreference(parsedUrl, getGlobalSettings());
256+
openLinkWithUserPreference(parsedUrl, globalSettings);
256257
return;
257258
}
258259

@@ -277,9 +278,9 @@ export const messageLinkPress =
277278

278279
await dispatch(doNarrowNearLink(narrow, nearOperand));
279280
} else if (!isUrlOnRealm(parsedUrl, auth.realm)) {
280-
openLinkWithUserPreference(parsedUrl, getGlobalSettings());
281+
openLinkWithUserPreference(parsedUrl, globalSettings);
281282
} else {
282283
const url = (await api.tryGetFileTemporaryUrl(parsedUrl, auth)) ?? parsedUrl;
283-
openLinkWithUserPreference(url, getGlobalSettings());
284+
openLinkWithUserPreference(url, globalSettings);
284285
}
285286
};

0 commit comments

Comments
 (0)