mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Merge pull request #14 from kihashi/feature/#12-encode-data-strings
Added base64 encoding of the string.
This commit is contained in:
commit
5f1bf11187
6
main.js
6
main.js
@ -16,13 +16,13 @@ var v = new Vue({
|
|||||||
this.fetchData();
|
this.fetchData();
|
||||||
new Clipboard('.copy');
|
new Clipboard('.copy');
|
||||||
storedUserData = localStorage.getItem('user_data');
|
storedUserData = localStorage.getItem('user_data');
|
||||||
if(storedUserData !== null){
|
if(storedUserData !== null && storedUserData !== ""){
|
||||||
this.loadData(storedUserData);
|
this.loadData(storedUserData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
user_data_serialized: function(){
|
user_data_serialized: function(){
|
||||||
return JSON.stringify(this.user_data);
|
return btoa(JSON.stringify(this.user_data));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -45,7 +45,7 @@ var v = new Vue({
|
|||||||
this.load_mode = false;
|
this.load_mode = false;
|
||||||
},
|
},
|
||||||
loadData: function(data){
|
loadData: function(data){
|
||||||
this.user_data = JSON.parse(data);
|
this.user_data = JSON.parse(atob(data));
|
||||||
this.exitLoadMode();
|
this.exitLoadMode();
|
||||||
},
|
},
|
||||||
enterSaveMode: function(){
|
enterSaveMode: function(){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user