Comments (3)
Hm, history management is complicated... I might have to switch entirely to pushState/replaceState/onpopstate for it to work, and it might make sense to use an abstraction like history.js
from jspaint.
Okay, I overcomplicated it. I saw some behavior that made me think I needed something like this:
if(current_session){
end_current_session();
// console.log("pushState");
// history.pushState(null, document.title, "#local:" + new_session_id);
console.log("set location.hash");
location.hash = "#local:" + new_session_id;
}else{
console.log("replaceState");
history.replaceState(null, document.title, "#local:" + new_session_id);
}
but my original approach does actually work as far as I can tell:
end_current_session();
var new_session_id = generate_session_id();
history.replaceState(null, document.title, "#local:" + new_session_id);
..oh wait, but I do need to listen to popstate
in addition to hashchange
. but then it works!
from jspaint.
Fixed in 662bf53
from jspaint.
Related Issues (20)
- Unable to Rotate By Angle HOT 2
- "Width" field is not focused and selected when opening Image -> Attributes... HOT 3
- How to open multiple windows in electron macOS? HOT 2
- why does electron app make requests to internet when started? HOT 4
- Bucket tool went weird today HOT 5
- i cant draw after making 1 brushstroke or anything on the canvas HOT 3
- Pixel data offset field from the BMP header is ignored
- The Recover Document (Woah!) pop-up still occurs despite the following HOT 2
- Blended/Anti-Aliased edges on rectangle tool HOT 4
- every stroke i make does not save on the canvas and keeps deleting the previous one HOT 31
- [feature] comic creator
- Shortcut keys?
- Pasted screenshots show up twice as big (HiDPI Retina screenshot) HOT 1
- Error when changing eraser size with keyboard
- Internal copy not working on macOS Safari
- Error trying to paste a screenshot on Windows 11
- Errors trying to paste/open an SVG file
- Shift+Insert, Ctrl+Insert, and Ctrl+Delete shortcuts throw errors HOT 1
- .bmp file saves incorrectly
- [feature] Windows 3.1 style tools HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jspaint.