Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
{
_module = await JSRuntime.LoadModule($"{WebsiteOption.Value.JSModuleRootPath}Layout/BaseLayout.razor.js");
_interop = DotNetObjectReference.Create(this);
await _module.InvokeVoidAsync("doTask", _interop);
await _module.InvokeVoidAsync("doTask", _interop, WebsiteOption.Value.IsDevelopment);
_init = true;
StateHasChanged();
}
Expand Down
15 changes: 9 additions & 6 deletions src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getTheme, setTheme } from "../../_content/BootstrapBlazor/modules/utility.js"
import { getTheme, setTheme } from "../../_content/BootstrapBlazor/modules/utility.js"
import EventHandler from "../../_content/BootstrapBlazor/modules/event-handler.js"

function initTheme() {
const currentTheme = getTheme();
setTheme(currentTheme, false);
}

export function doTask(invoke) {
export function doTask(invoke, debug) {
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name "debug" is inconsistent with the C# property name "IsDevelopment" being passed from BaseLayout.razor.cs. Consider renaming the parameter to "isDevelopment" to better reflect what it represents and maintain naming consistency across the codebase.

Copilot uses AI. Check for mistakes.
initTheme();

const v = localStorage.getItem('bb-gitee-vote');
Expand All @@ -21,10 +21,13 @@ export function doTask(invoke) {
localStorage.removeItem('bb-gitee-vote');
}
}
const handler = setTimeout(async () => {
clearTimeout(handler);
await invoke.invokeMethodAsync("ShowVoteToast");
}, 10000);

if (debug !== true) {
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name "debug" is inconsistent with the C# property name "IsDevelopment" being passed from BaseLayout.razor.cs. Consider renaming to "isDevelopment" to better reflect what it represents and maintain naming consistency across the codebase.

Copilot uses AI. Check for mistakes.
const handler = setTimeout(async () => {
clearTimeout(handler);
await invoke.invokeMethodAsync("ShowVoteToast");
}, 10000);
}

EventHandler.on(document, 'click', '#bb-gitee-vote', e => {
const toast = e.delegateTarget.closest('.toast');
Expand Down
Loading