shannon fdca50179e Wait for authentications to be available before trying to use them.
The prior fix for memory corruption problems in authentications had caused the app to launch to the new user screen every time.
2024-10-30 14:41:48 -04:00

32 lines
727 B
Swift

//
// IntentHandler.swift
// MastodonIntent
//
// Created by Cirno MainasuK on 2021-7-26.
//
import Intents
import MastodonCore
class IntentHandler: INExtension {
@MainActor
override func handler(for intent: INIntent) -> Any {
AuthenticationServiceProvider.shared.prepareForUse()
switch intent {
case is SendPostIntent:
return SendPostIntentHandler()
case is FollowersCountIntent:
return FollowersCountIntentHandler()
case is MultiFollowersCountIntent:
return MultiFollowersCountIntentHandler()
case is HashtagIntent:
return HashtagIntentHandler()
default:
return self
}
}
}