Skip to content

Commit

Permalink
chore: redirect to plugin select after push
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 29, 2024
1 parent 87f33d1 commit 74ad0cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions static/manifest-gui.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ header #uos-logo path {
max-height: calc(100vh - 192px);
scrollbar-width: thin;
scrollbar-color: #303030 #101010;
opacity: 1;
transition: opacity 0.5s ease;
}

.readme-container p {
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rendering/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function createBackButton(renderer: ManifestRenderer): HTMLButtonElement
return backButton;
}

function handleBackButtonClick(renderer: ManifestRenderer): void {
export function handleBackButtonClick(renderer: ManifestRenderer): void {
renderer.manifestGui?.classList.remove("plugin-editor");
const readmeContainer = document.querySelector(".readme-container");
if (readmeContainer) {
Expand Down
18 changes: 18 additions & 0 deletions static/scripts/rendering/write-add-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { parseConfigInputs } from "./input-parsing";
import { getOfficialPluginConfig } from "../../utils/storage";
import { renderConfigEditor } from "./config-editor";
import { normalizePluginName } from "./utils";
import { renderPluginSelector } from "./plugin-select";
import { handleBackButtonClick } from "./navigation";

/**
* Writes the new configuration to the config file. This does not push the config to GitHub
Expand Down Expand Up @@ -122,6 +124,22 @@ async function notificationConfigPush(renderer: ManifestRenderer) {
type: "success",
shouldAutoDismiss: true,
});

const container = document.querySelector("#manifest-gui") as HTMLElement | null;
const readmeContainer = document.querySelector(".readme-container") as HTMLElement | null;
if (container && readmeContainer) {
container.style.transition = 'opacity 0.5s ease';
container.style.opacity = '0';
readmeContainer.style.transition = 'opacity 0.5s ease';
readmeContainer.style.opacity = '0';
setTimeout(() => {
handleBackButtonClick(renderer);
container.style.opacity = '1';
}, 500);

} else {
handleBackButtonClick(renderer);
}
}

export function handleResetToDefault(renderer: ManifestRenderer, pluginManifest: Manifest | null) {
Expand Down

0 comments on commit 74ad0cd

Please sign in to comment.