Added feedback
This commit is contained in:
parent
d865ac8e06
commit
f46aabb4d3
8 changed files with 148 additions and 61 deletions
|
|
@ -1,14 +1,20 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import history from '/imports/ui/components/History/History';
|
||||
|
||||
export const location = new ReactiveVar();
|
||||
export const location = new ReactiveVar(history.location.pathname);
|
||||
|
||||
export const currentLocation = () => {
|
||||
if (Meteor.isClient) {
|
||||
return window.location.pathname;
|
||||
}
|
||||
return location.get();
|
||||
};
|
||||
if (Meteor.isClient) {
|
||||
history.listen((loc) => { // , action) => {
|
||||
// console.log(`The current URL is ${location.pathname}${location.search}${location.hash}`)
|
||||
// console.log(`The last navigation action was ${action}`)
|
||||
location.set(loc.pathname);
|
||||
});
|
||||
}
|
||||
|
||||
export const currentLocation = () => location.get();
|
||||
|
||||
export const currentLocationHref = () => {
|
||||
if (Meteor.isClient) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue