From e63f176f8eb53a41d1aefb585cf86b88d6d254c0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 21 Jun 2023 18:46:01 +0300 Subject: [PATCH] macOS widgets --- macos/CompanyIntent/IntentHandler.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/macos/CompanyIntent/IntentHandler.swift b/macos/CompanyIntent/IntentHandler.swift index f0d9853be..cc61f7038 100644 --- a/macos/CompanyIntent/IntentHandler.swift +++ b/macos/CompanyIntent/IntentHandler.swift @@ -47,6 +47,13 @@ class IntentHandler: INExtension, ConfigurationIntentHandling { return INObjectCollection(items: currencies) } + func defaultCurrency(for intent: ConfigurationIntent) -> Currency? { + let widgetData = loadWidgetData() + let company = widgetData.companies[widgetData.companyId]; + let currency = company?.currencies[company!.currencyId]; + return Currency(identifier: currency!.id, display: currency!.name) + } + override func handler(for intent: INIntent) -> Any { return self }