You've already forked AstralRinth
forked from didirus/AstralRinth
Fix Cloudflare Pages build (#1285)
* fix(temp): remove box shadows from tailwind config * fix(temp): "polyfill" global during build process * refactor: use `import.meta` instead of deprecated `process` * oops: replace `process.server` as well
This commit is contained in:
@@ -1500,7 +1500,7 @@ const collapsedChecklist = ref(false);
|
||||
|
||||
const showModerationChecklist = ref(false);
|
||||
const futureProjects = ref([]);
|
||||
if (process.client && history && history.state && history.state.showChecklist) {
|
||||
if (import.meta.client && history && history.state && history.state.showChecklist) {
|
||||
showModerationChecklist.value = true;
|
||||
futureProjects.value = history.state.projects;
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ export default defineNuxtComponent({
|
||||
featured: false,
|
||||
};
|
||||
// For navigation from versions page / upload file prompt
|
||||
if (process.client && history.state && history.state.newPrimaryFile) {
|
||||
if (import.meta.client && history.state && history.state.newPrimaryFile) {
|
||||
replaceFile = history.state.newPrimaryFile;
|
||||
|
||||
try {
|
||||
|
||||
@@ -130,7 +130,7 @@ useHead({
|
||||
const user = await useUser();
|
||||
const auth = await useAuth();
|
||||
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
await initUserFollows();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ async function readAll() {
|
||||
|
||||
function changePage(newPage) {
|
||||
page.value = newPage;
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ const {
|
||||
} = useLazyFetch(
|
||||
() => {
|
||||
const config = useRuntimeConfig();
|
||||
const base = process.server ? config.apiBaseUrl : config.public.apiBaseUrl;
|
||||
const base = import.meta.server ? config.apiBaseUrl : config.public.apiBaseUrl;
|
||||
|
||||
const params = [`limit=${maxResults.value}`, `index=${sortType.value.name}`];
|
||||
|
||||
@@ -589,7 +589,7 @@ function onSearchChange(newPageNumber) {
|
||||
|
||||
refreshSearch();
|
||||
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
const obj = getSearchUrl((currentPage.value - 1) * maxResults.value, true);
|
||||
router.replace({ path: route.path, query: obj });
|
||||
}
|
||||
@@ -751,7 +751,7 @@ function toggleEnv(environment, sendRequest) {
|
||||
}
|
||||
|
||||
function onSearchChangeToTop(newPageNumber) {
|
||||
if (process.client) {
|
||||
if (import.meta.client) {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user