mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Merge f1e67886d5 into 472daf9c91
This commit is contained in:
commit
2af8d0ec92
@ -221,8 +221,14 @@ export default {
|
||||
methods: {
|
||||
LoadData: function () {
|
||||
if (this.DataToLoad !== '') {
|
||||
this.$store.commit('SetSerializedState', this.DataToLoad)
|
||||
alert('Data Loaded!')
|
||||
try {
|
||||
assertDataIsValid(this.DataToLoad);
|
||||
this.$store.commit('SetSerializedState', this.DataToLoad)
|
||||
alert('Data Loaded!')
|
||||
} catch (err) {
|
||||
console.error('Invalid data string');
|
||||
alert('Error loading data.')
|
||||
}
|
||||
}
|
||||
},
|
||||
ConfirmDelete: function () {
|
||||
@ -236,6 +242,10 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function assertDataIsValid(data) {
|
||||
JSON.parse(atob(data));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user