1
0
mirror of https://github.com/kihashi/stardew_community_checklist.git synced 2025-10-19 08:03:17 +00:00
This commit is contained in:
Sean Corrales 2021-01-05 08:59:06 -06:00 committed by GitHub
commit 2af8d0ec92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,8 +221,14 @@ export default {
methods: { methods: {
LoadData: function () { LoadData: function () {
if (this.DataToLoad !== '') { if (this.DataToLoad !== '') {
this.$store.commit('SetSerializedState', this.DataToLoad) try {
alert('Data Loaded!') 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 () { ConfirmDelete: function () {
@ -236,6 +242,10 @@ export default {
} }
} }
} }
function assertDataIsValid(data) {
JSON.parse(atob(data));
}
</script> </script>
<style> <style>