fix: ID not being reset when creating new feeds, causing unintentional edits over existing feeds
All checks were successful
Build / build (push) Successful in 39s

This commit is contained in:
Corban-Lee Jones 2025-05-02 13:43:59 +01:00
parent 73aed35ce0
commit a0d2711a51

View File

@ -1,11 +1,10 @@
import $ from "jquery";
import "datatables.net-select-dt";
import DataTable, { Api } from "datatables.net-dt"
import HSDropdown from "@preline/dropdown";
import HSOverlay, { IOverlayOptions } from "@preline/overlay";
import HSSelect, { ISelectOptions } from "@preline/select";
import HSDataTable, { IDataTableOptions } from "@preline/datatable";
import { ConfigColumnDefs, AjaxSettings } from "datatables.net-dt";
import DataTable, { Api, ConfigColumnDefs, AjaxSettings } from "datatables.net-dt";
import { autoUpdate, computePosition, offset } from "@floating-ui/dom";
import { formatTimestamp, verifyChannels } from "../../../src/ts/main";
import prisma from "../../../../../generated/prisma";
@ -314,7 +313,7 @@ const pageSelectOptions: ISelectOptions = {
</div>`,
toggleClasses: "cj-table-paging-select-toggle",
optionClasses: "cj-table-paging-select-option",
dropdownClasses: `cj-table-paging-select-dropdown`,
dropdownClasses: "cj-table-paging-select-dropdown",
dropdownSpace: 10,
dropdownScope: "parent",
dropdownPlacement: "top",
@ -348,7 +347,7 @@ interface FeedWithChannels extends prisma.Feed {
}
const clearEditModalData = () => {
$(editModal.el).data("id", undefined);
$(editModal.el).removeData("id");
$("#formName").val("");
$("#formUrl").val("");
@ -377,6 +376,7 @@ const openEditModal = async (id: number | undefined) => {
// when determining the width of the input placeholder 'Select option...'. This
// requires the modal to be opened before running the calculation, which could be
// bad.
$("#editForm").removeClass("submitted");
editModal.open();
id === undefined