From 80263888dd9bd416ea1db84211eb2005e09bb8bd Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Tue, 28 May 2024 22:07:37 +0200 Subject: [PATCH] Minor syntax improvement to UserSpace --- App/Sources/Core/UserSpace.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/App/Sources/Core/UserSpace.swift b/App/Sources/Core/UserSpace.swift index 93a6e337..90845b32 100644 --- a/App/Sources/Core/UserSpace.swift +++ b/App/Sources/Core/UserSpace.swift @@ -262,13 +262,11 @@ final class UserSpace: @unchecked Sendable { configurationSubscription = publisher .sink { [weak self] configuration in guard let self = self else { return } - Task { - await MainActor.run { - let currentModes = configuration.userModes - .map { UserMode(id: $0.id, name: $0.name, isEnabled: false) } - .sorted(by: { $0.name < $1.name }) - self.userModes = currentModes - } + Task { @MainActor in + let currentModes = configuration.userModes + .map { UserMode(id: $0.id, name: $0.name, isEnabled: false) } + .sorted(by: { $0.name < $1.name }) + self.userModes = currentModes } } }