fix: opt in to import.meta.* properties (#364)
This commit is contained in:
@@ -12,7 +12,7 @@ export const pendingSubmission = (form) => {
|
||||
})
|
||||
|
||||
const set = (value) => {
|
||||
if (process.server || !enabled.value) return
|
||||
if (import.meta.server || !enabled.value) return
|
||||
useStorage(formPendingSubmissionKey.value).value = value === null ? value : JSON.stringify(value)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export const pendingSubmission = (form) => {
|
||||
}
|
||||
|
||||
const get = (defaultValue = {}) => {
|
||||
if (process.server || !enabled.value) return
|
||||
if (import.meta.server || !enabled.value) return
|
||||
const pendingSubmission = useStorage(formPendingSubmissionKey.value).value
|
||||
return pendingSubmission ? JSON.parse(pendingSubmission) : defaultValue
|
||||
}
|
||||
|
||||
2
client/composables/useCrisp.js
vendored
2
client/composables/useCrisp.js
vendored
@@ -1,6 +1,6 @@
|
||||
export const useCrisp = () => {
|
||||
|
||||
let crisp = process.client ? window.Crisp : null
|
||||
let crisp = import.meta.client ? window.Crisp : null
|
||||
|
||||
function openChat() {
|
||||
if (!crisp) return
|
||||
|
||||
2
client/composables/useIsIframe.js
vendored
2
client/composables/useIsIframe.js
vendored
@@ -1,5 +1,5 @@
|
||||
export const useIsIframe = () => {
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
return window.location !== window.parent.location || window.frameElement
|
||||
}
|
||||
return false
|
||||
|
||||
2
client/composables/useOpnApi.js
vendored
2
client/composables/useOpnApi.js
vendored
@@ -39,7 +39,7 @@ export function getOpnRequestsOptions(request, opts) {
|
||||
opts.headers = {accept: 'application/json', ...opts.headers}
|
||||
|
||||
// Authenticate requests coming from the server
|
||||
if (process.server && config.apiSecret) {
|
||||
if (import.meta.server && config.apiSecret) {
|
||||
opts.headers['x-api-secret'] = config.apiSecret
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user