-
-
Save saifulapm/4c2eb84531ad68133a96b9e342a0d592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var syncStore = { | |
| action: "syncNow", | |
| token: '' | |
| }; | |
| function startSyncStore(callback) { | |
| $.ajax({ | |
| type: 'POST', | |
| url: "/sync", | |
| dataType: 'json', | |
| data: syncStore | |
| }).done(function(json) { | |
| console.log(json); | |
| if (json.type === "success") { | |
| if (json.token && json.token.constructor.toString().indexOf("Array") === -1) { | |
| syncStore.token = json.token.page_info; | |
| localStorage.setItem("page_info", json.token.page_info); | |
| setTimeout(callback, 1000); | |
| } else { | |
| console.log('Completed'); | |
| } | |
| } | |
| }); | |
| } | |
| (function syncNow() { | |
| startSyncStore(syncNow); | |
| })(); |
saifulapm
commented
Jun 21, 2021
Author
- Search Page Filter
- Collection Page Filter
- Perfect Fit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment