Skip to content

Commit 3a75495

Browse files
authored
Merge pull request LykosAI#1241 from ionite34/merge-LykosAI-StabilityMatrix-Dev-main-to-main-cebec16
Merge LykosAI/StabilityMatrix-Dev/main into main
2 parents 857224f + 351bb23 commit 3a75495

2 files changed

Lines changed: 31 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8-
## v2.15.8
8+
## [Unreleased - v2.15.8]
99
### Added
1010
- Added support for the civitai.red (mature-content) domain — NSFW CivitAI links now open and copy as civitai.red URLs, and pasting a civitai.red URL into the CivitAI model browser search works the same as a civitai.com URL
1111
### Changed
1212
- The CivitAI base model type filter now uses CivitAI's official `/api/v1/enums` endpoint, with fallbacks to the previous technique and a built-in list, so the filter stays populated even if the CivitAI response format changes or the service is unreachable
1313
### Fixed
14+
- Fixed [#1608](https://github.com/LykosAI/StabilityMatrix/issues/1608) - Crash when cdn fetch fails due to error notification not being shown on UI Thread - thanks to @NeuralFault!
1415
- Fixed CivitAI model browsing breaking during Discovery API outages — the browser now falls back to the direct CivitAI API when Discovery returns a server error, authentication failure, or times out
1516
- Fixed SwarmUI user settings (theme, output format, server configuration, etc.) and any user-added backend entries being overwritten when the install flow ran over an existing install — `Settings.fds` and `Backends.fds` are now merged with their existing contents instead of being rewritten from a stale template
1617

StabilityMatrix.Avalonia/Services/NotificationService.cs

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ public void Initialize(
4141
notificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(visual))
4242
{
4343
Position = position,
44-
MaxItems = maxItems
44+
MaxItems = maxItems,
4545
};
4646
}
4747

4848
public void Show(INotification notification)
4949
{
50-
notificationManager?.Show(notification);
50+
// Must marshal to UI thread - WindowNotificationManager requires it
51+
Dispatcher.UIThread.Invoke(() => notificationManager?.Show(notification));
5152
}
5253

5354
/// <inheritdoc />
@@ -94,25 +95,23 @@ bool isPersistent
9495
// Show app toast
9596
if (isPersistent)
9697
{
97-
Dispatcher.UIThread.Invoke(
98-
() =>
99-
ShowPersistent(
100-
notification.Title ?? "",
101-
notification.Body ?? "",
102-
key.Level.ToNotificationType()
103-
)
98+
Dispatcher.UIThread.Invoke(() =>
99+
ShowPersistent(
100+
notification.Title ?? "",
101+
notification.Body ?? "",
102+
key.Level.ToNotificationType()
103+
)
104104
);
105105
}
106106
else
107107
{
108-
Dispatcher.UIThread.Invoke(
109-
() =>
110-
Show(
111-
notification.Title ?? "",
112-
notification.Body ?? "",
113-
key.Level.ToNotificationType(),
114-
expiration
115-
)
108+
Dispatcher.UIThread.Invoke(() =>
109+
Show(
110+
notification.Title ?? "",
111+
notification.Body ?? "",
112+
key.Level.ToNotificationType(),
113+
expiration
114+
)
116115
);
117116
}
118117
return;
@@ -130,25 +129,23 @@ await nativeManager.ShowNotification(
130129
// Show app toast
131130
if (isPersistent)
132131
{
133-
Dispatcher.UIThread.Invoke(
134-
() =>
135-
ShowPersistent(
136-
notification.Title ?? "",
137-
notification.Body ?? "",
138-
key.Level.ToNotificationType()
139-
)
132+
Dispatcher.UIThread.Invoke(() =>
133+
ShowPersistent(
134+
notification.Title ?? "",
135+
notification.Body ?? "",
136+
key.Level.ToNotificationType()
137+
)
140138
);
141139
}
142140
else
143141
{
144-
Dispatcher.UIThread.Invoke(
145-
() =>
146-
Show(
147-
notification.Title ?? "",
148-
notification.Body ?? "",
149-
key.Level.ToNotificationType(),
150-
expiration
151-
)
142+
Dispatcher.UIThread.Invoke(() =>
143+
Show(
144+
notification.Title ?? "",
145+
notification.Body ?? "",
146+
key.Level.ToNotificationType(),
147+
expiration
148+
)
152149
);
153150
}
154151

0 commit comments

Comments
 (0)