Migrate code to new history store

This commit is contained in:
Andrew Bastin
2021-05-24 22:08:49 -04:00
parent 8cd3acd205
commit fcac750ad7
5 changed files with 124 additions and 93 deletions

View File

@@ -481,7 +481,6 @@ import { commonHeaders } from "~/helpers/headers"
import { getPlatformSpecialKey } from "~/helpers/platformutils"
import { sendNetworkRequest } from "~/helpers/network"
import { getSettingSubject } from "~/newstore/settings"
import { fb } from "~/helpers/fb"
export default {
beforeRouteLeave(_to, _from, next) {
@@ -853,12 +852,8 @@ export default {
duration,
}
// TODO: Use history store system mechanism instead!
this.$refs.graphqlHistoryComponent.addEntry(entry)
if (fb.currentUser !== null && fb.currentSettings[2]) {
if (fb.currentSettings[2].value) {
fb.writeGraphqlHistory(entry)
}
}
} catch (error) {
this.response = `${error}. ${this.$t("check_console_details")}`
this.$nuxt.$loading.finish()

View File

@@ -1,4 +1,5 @@
<template>
<!-- eslint-disable -->
<div class="page">
<div class="content">
<div class="page-columns inner-left">
@@ -651,6 +652,8 @@
</template>
<script>
/* eslint-disable */
import url from "url"
import querystring from "querystring"
import parseCurlCommand from "~/helpers/curlparser"
@@ -1406,10 +1409,8 @@ export default {
entry.url = parseTemplateString(entry.url, environmentVariables)
}
// TODO: Use the history store mechanism instead!
this.$refs.historyComponent.addEntry(entry)
if (fb.currentUser !== null && this.SYNC_COLLECTIONS) {
fb.writeHistory(entry)
}
})()
} catch (error) {
this.runningRequest = false
@@ -1464,10 +1465,8 @@ export default {
entry.url = parseTemplateString(entry.url, environmentVariables)
}
// TODO: Use the history state mechanism instead!
this.$refs.historyComponent.addEntry(entry)
if (fb.currentUser !== null && this.SYNC_HISTORY) {
fb.writeHistory(entry)
}
return
} else {
this.response.status = error.message