Compare commits

..

1 Commits

Author SHA1 Message Date
Calum H.
8ef27c3a60 revert: dont use local storage for filters 2025-08-05 13:18:03 +01:00
4 changed files with 5 additions and 33 deletions

View File

@@ -100,7 +100,6 @@ import {
ScaleIcon,
} from "@modrinth/assets";
import { defineMessages, useVIntl } from "@vintl/vintl";
import { useLocalStorage } from "@vueuse/core";
import ConfettiExplosion from "vue-confetti-explosion";
import Fuse from "fuse.js";
import ModerationQueueCard from "~/components/ui/moderation/ModerationQueueCard.vue";
@@ -215,7 +214,7 @@ watch(
},
);
const currentFilterType = useLocalStorage("moderation-current-filter-type", () => "All projects");
const currentFilterType = ref("All projects");
const filterTypes: readonly string[] = readonly([
"All projects",
"Modpacks",
@@ -226,7 +225,7 @@ const filterTypes: readonly string[] = readonly([
"Shaders",
]);
const currentSortType = useLocalStorage("moderation-current-sort-type", () => "Oldest");
const currentSortType = ref("Oldest");
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
const currentPage = ref(1);

View File

@@ -72,7 +72,6 @@
import { DropdownSelect, Button, Pagination } from "@modrinth/ui";
import { XIcon, SearchIcon, SortAscIcon, SortDescIcon, FilterIcon } from "@modrinth/assets";
import { defineMessages, useVIntl } from "@vintl/vintl";
import { useLocalStorage } from "@vueuse/core";
import type { Report } from "@modrinth/utils";
import Fuse from "fuse.js";
import type { ExtendedReport } from "@modrinth/moderation";
@@ -170,10 +169,10 @@ watch(
},
);
const currentFilterType = useLocalStorage("moderation-reports-filter-type", () => "All");
const currentFilterType = ref("All");
const filterTypes: readonly string[] = readonly(["All", "Unread", "Read"]);
const currentSortType = useLocalStorage("moderation-reports-sort-type", () => "Oldest");
const currentSortType = ref("Oldest");
const sortTypes: readonly string[] = readonly(["Oldest", "Newest"]);
const currentPage = ref(1);

View File

@@ -512,7 +512,6 @@ pub async fn project_edit(
moderation_message_body: v2_new_project.moderation_message_body,
monetization_status: v2_new_project.monetization_status,
side_types_migration_review_status: None, // Not to be exposed in v2
loader_fields: HashMap::new(), // Loader fields are not a thing in v2
};
// This returns 204 or failure so we don't need to do anything with it

View File

@@ -11,7 +11,7 @@ use crate::database::redis::RedisPool;
use crate::database::{self, models as db_models};
use crate::file_hosting::{FileHost, FileHostPublicity};
use crate::models;
use crate::models::ids::{ProjectId, VersionId};
use crate::models::ids::ProjectId;
use crate::models::images::ImageContext;
use crate::models::notifications::NotificationBody;
use crate::models::pats::Scopes;
@@ -250,8 +250,6 @@ pub struct EditProject {
pub monetization_status: Option<MonetizationStatus>,
pub side_types_migration_review_status:
Option<SideTypesMigrationReviewStatus>,
#[serde(flatten)]
pub loader_fields: HashMap<String, serde_json::Value>,
}
#[allow(clippy::too_many_arguments)]
@@ -872,29 +870,6 @@ pub async fn project_edit(
.await?;
}
if !new_project.loader_fields.is_empty() {
for version in db_models::DBVersion::get_many(
&project_item.versions,
&**pool,
&redis,
)
.await?
{
super::versions::version_edit_helper(
req.clone(),
(VersionId::from(version.inner.id),),
pool.clone(),
redis.clone(),
super::versions::EditVersion {
fields: new_project.loader_fields.clone(),
..Default::default()
},
session_queue.clone(),
)
.await?;
}
}
// check new description and body for links to associated images
// if they no longer exist in the description or body, delete them
let checkable_strings: Vec<&str> =