Firebase sync

This commit is contained in:
Liyas Thomas
2020-02-24 00:30:22 +05:30
parent 010be95ed5
commit d24c572d7f
8 changed files with 164 additions and 76 deletions

View File

@@ -1086,7 +1086,7 @@
<pw-section class="pink" :label="$t('notes')" ref="sync">
<div v-if="fb.currentUser">
<inputform />
<ballsfeed />
<notes />
</div>
<div v-else>
<ul>
@@ -1456,7 +1456,7 @@ export default {
saveRequestAs: () => import("../components/collections/saveRequestAs"),
Editor: AceEditor,
inputform: () => import("../components/firebase/inputform"),
ballsfeed: () => import("../components/firebase/feeds"),
notes: () => import("../components/firebase/feeds"),
environments: () => import("../components/environments")
},
data() {
@@ -2047,12 +2047,14 @@ export default {
},
methods: {
useSelectedEnvironment(environment) {
let preRequestScriptString = ''
let preRequestScriptString = "";
for (let variable of environment.variables) {
preRequestScriptString = preRequestScriptString + `pw.env.set('${variable.key}', '${variable.value}');\n`
preRequestScriptString =
preRequestScriptString +
`pw.env.set('${variable.key}', '${variable.value}');\n`;
}
this.preRequestScript = preRequestScriptString
this.showPreRequestScript = true
this.preRequestScript = preRequestScriptString;
this.showPreRequestScript = true;
},
checkCollections() {
const checkCollectionAvailability =
@@ -2247,7 +2249,7 @@ export default {
};
this.$refs.historyComponent.addEntry(entry);
if (fb.currentUser !== null) {
if (fb.currentSettings[1].value) {
if (fb.currentSettings[2].value) {
fb.writeHistory(entry);
}
}
@@ -2284,7 +2286,7 @@ export default {
};
this.$refs.historyComponent.addEntry(entry);
if (fb.currentUser !== null) {
if (fb.currentSettings[1].value) {
if (fb.currentSettings[2].value) {
fb.writeHistory(entry);
}
}

View File

@@ -38,7 +38,7 @@
{{ setting.value ? $t("enabled") : $t("disabled") }}
</pw-toggle>
</p>
<p v-if="fb.currentSettings.length == 0">
<p v-if="fb.currentSettings.length !== 3">
<button class="" @click="initSettings">
<i class="material-icons">sync</i>
<span>{{ $t("turn_on") + " " + $t("sync") }}</span>
@@ -433,7 +433,8 @@ export default {
text: this.$t("yes"),
onClick: (e, toastObject) => {
fb.writeSettings("syncHistory", true);
fb.writeSettings("syncCollections", false);
fb.writeSettings("syncCollections", true);
fb.writeSettings("syncEnvironments", true);
this.$router.push({ path: "/settings" });
toastObject.remove();
}
@@ -462,7 +463,8 @@ export default {
text: this.$t("yes"),
onClick: (e, toastObject) => {
fb.writeSettings("syncHistory", true);
fb.writeSettings("syncCollections", false);
fb.writeSettings("syncCollections", true);
fb.writeSettings("syncEnvironments", true);
this.$router.push({ path: "/settings" });
toastObject.remove();
}
@@ -481,7 +483,8 @@ export default {
},
initSettings() {
fb.writeSettings("syncHistory", true);
fb.writeSettings("syncCollections", false);
fb.writeSettings("syncCollections", true);
fb.writeSettings("syncEnvironments", true);
},
resetProxy({ target }) {
this.settings.PROXY_URL = `https://postwoman.apollotv.xyz/`;