Skip to content

Commit 1d2e495

Browse files
authored
Merge pull request #30 from mrbeam/feature/SW-2058-pop-up-to-guide-the-user-to-do-hard-refresh-after-update
adding comments and deleting the cookie on confirm click
2 parents 068d4c6 + 5d9c90f commit 1d2e495

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

octoprint_mrbeam/static/js/hard_refresh_overlay.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ $(function () {
1717
}
1818

1919
};
20+
//can be used with newer octoprint version
2021
self.onEventplugin_softwareupdate_update_succeeded = function () {
2122
document.cookie = "f.u.extra=true"
2223
}
24+
// needs to be used for oprint 1.3.6
2325
self.onDataUpdaterPluginMessage = function (plugin, data) {
2426
console.log("hard_refresh", plugin, data);
2527
if (plugin === "softwareupdate") {
2628
if ("type" in data && (data["type"] === "success" || data["type"] === "restarting" || data["type"] === "restart_manually")) {
27-
document.cookie = "f.u.extra=true";
29+
document.cookie = "f.u.extra=true"; // add cookie
2830
}
2931
}
3032
}
3133
self.setUserHardRefreshed = function () {
32-
// document.cookie = "f.u.extra= ; expires = Thu, 01 Jan 1970 00:00:00 GMT"//delete cookie
34+
document.cookie = "f.u.extra= ; expires = Thu, 01 Jan 1970 00:00:00 GMT" // delete cookie
3335
}
3436
}
3537

0 commit comments

Comments
 (0)