mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-28 12:36:41 +07:00
finally saving things
This commit is contained in:
parent
e0f5d0238a
commit
47e4f4a97d
22 changed files with 277 additions and 38 deletions
|
@ -1,12 +1,13 @@
|
|||
export const getPath = () => (window.location && window.location.pathname &&
|
||||
window.location.pathname.replace(/^\//, ''));
|
||||
|
||||
export const replacePath = url => window.history.replaceState(url, 'Редактирование маршрута', url);
|
||||
export const pushPath = url => window.history.pushState(url, 'Редактирование маршрута', url);
|
||||
|
||||
export const getUrlData = () => {
|
||||
const url = getPath();
|
||||
|
||||
const [path, mode] = url.split('/');
|
||||
const { host } = window.location;
|
||||
|
||||
return { path, mode };
|
||||
return { path, mode, host };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue