🐛 Fixed error on Download feed

This commit is contained in:
Liyas Thomas
2020-01-22 12:47:09 +05:30
parent ea7feee840
commit 860993663f
3 changed files with 11 additions and 11 deletions

View File

@@ -59,13 +59,12 @@ export default {
methods: { methods: {
deleteFeed(feed) { deleteFeed(feed) {
fb.deleteFeed(feed.id); fb.deleteFeed(feed.id);
this.$toast.error(this.$t("deleted"), {
icon: "delete"
});
}, },
saveFeed(feed) { saveFeed(feed) {
const dataToWrite = JSON.stringify( const dataToWrite = JSON.stringify(feed.message, null, 2);
eval("(" + feed.message + ")"),
null,
2
);
const file = new Blob([dataToWrite], { type: "application/json" }); const file = new Blob([dataToWrite], { type: "application/json" });
const a = document.createElement("a"), const a = document.createElement("a"),
url = URL.createObjectURL(file); url = URL.createObjectURL(file);

View File

@@ -40,11 +40,12 @@ export const fb = {
return console.error("error inserting", dt, e); return console.error("error inserting", dt, e);
} }
}, },
deleteFeed: id => deleteFeed: id => {
feedsCollection feedsCollection
.doc(id) .doc(id)
.delete() .delete()
.catch(e => console.error("error deleting", dt, e)), .catch(e => console.error("error deleting", dt, e));
},
writeSettings: async (setting, value) => { writeSettings: async (setting, value) => {
const st = { const st = {
updatedOn: new Date(), updatedOn: new Date(),

View File

@@ -6,7 +6,7 @@
<div v-if="!fb.currentUser"> <div v-if="!fb.currentUser">
<label>{{ $t("login_with") }}</label> <label>{{ $t("login_with") }}</label>
<p> <p>
<button class="icon" @click="signInWithGoogle" v-close-popover> <button class="icon" @click="signInWithGoogle">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -21,7 +21,7 @@
<span>Google</span> <span>Google</span>
</button> </button>
<br /> <br />
<button class="icon" @click="signInWithGithub" v-close-popover> <button class="icon" @click="signInWithGithub">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -57,12 +57,12 @@
</span> </span>
</button> </button>
<br /> <br />
<button class="icon" @click="logout" v-close-popover> <button class="icon" @click="logout">
<i class="material-icons">exit_to_app</i> <i class="material-icons">exit_to_app</i>
<span>{{ $t("logout") }}</span> <span>{{ $t("logout") }}</span>
</button> </button>
<br /> <br />
<p v-for="setting in fb.currentSettings"> <p v-for="setting in fb.currentSettings" :key="setting.id">
<pw-toggle <pw-toggle
:key="setting.name" :key="setting.name"
:on="setting.value" :on="setting.value"