repo.or.cz
/
ProtonMail-WebClient.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git]
/
packages
/
drive-store
/
utils
/
url
/
localid.ts
blob
9adcb0687976bfb678559f02c8e11e6fe35ebabd
1
const sessionRegex = /\/u\/(\d+)\//;
2
export const getLocalID = (url = window.location.href): string | null => {
3
try {
4
const pathName = new URL(url).pathname;
5
const match = pathName.match(sessionRegex);
6
const localID = match ? match[1] : null;
7
return localID;
8
} catch {
9
return null;
10
}
11
};