Page MenuHomePhabricator

D3335.diff
No OneTemporary

D3335.diff

diff --git a/lib/utils/url-utils.js b/lib/utils/url-utils.js
--- a/lib/utils/url-utils.js
+++ b/lib/utils/url-utils.js
@@ -3,13 +3,14 @@
import urlParseLax from 'url-parse-lax';
export type URLInfo = {
- year?: number,
- month?: number, // 1-indexed
- verify?: string,
- calendar?: boolean,
- chat?: boolean,
- apps?: boolean,
- thread?: string,
+ +year?: number,
+ +month?: number, // 1-indexed
+ +verify?: string,
+ +calendar?: boolean,
+ +chat?: boolean,
+ +apps?: boolean,
+ +thread?: string,
+ +settings?: 'account',
...
};
@@ -20,6 +21,7 @@
const calendarRegex = new RegExp('(/|^)calendar(/|$)', 'i');
const chatRegex = new RegExp('(/|^)chat(/|$)', 'i');
const appsRegex = new RegExp('(/|^)apps(/|$)', 'i');
+const accountSettingsRegex = new RegExp('(/|^)settings/account(/|$)', 'i');
function infoFromURL(url: string): URLInfo {
const yearMatches = yearRegex.exec(url);
@@ -29,6 +31,7 @@
const calendarTest = calendarRegex.test(url);
const chatTest = chatRegex.test(url);
const appsTest = appsRegex.test(url);
+ const accountSettingsTest = accountSettingsRegex.test(url);
const returnObj = {};
if (yearMatches) {
returnObj.year = parseInt(yearMatches[2], 10);
@@ -52,6 +55,8 @@
returnObj.chat = true;
} else if (appsTest) {
returnObj.apps = true;
+ } else if (accountSettingsTest) {
+ returnObj.settings = 'account';
}
return returnObj;
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 10:53 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676814
Default Alt Text
D3335.diff (1 KB)

Event Timeline