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
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.6.0</Version>
<Version>9.6.1-beta01</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 7 additions & 3 deletions src/BootstrapBlazor/wwwroot/modules/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,17 +822,21 @@ export function registerBootstrapBlazorModule(name, identifier, callback) {
}
if (this._init === false) {
this._init = true;
cb(this);
if (isFunction(cb)) {
cb(this);
}
Comment on lines +825 to +827
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting the callback validation and invocation logic into a helper function to reduce duplication between the register and dispose methods.

Suggested change
if (isFunction(cb)) {
cb(this);
}
validateAndInvokeCallback(cb, this);

Copilot uses AI. Check for mistakes.
}
return this;
},
dispose: function (id, cb) {
if (id) {
this._items = this._items.filter(item => item !== id);
}
if (this._items.length === 0 && cb) {
if (this._items.length === 0) {
this._init = false;
cb(this);
if (isFunction(cb)) {
cb(this);
}
}
}
};
Expand Down