mirror of
https://github.com/immich-app/immich.git
synced 2025-11-02 02:27:09 -05:00
* skip posting message after detached from engine * review changes * cancel plugin before destroying engine --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
18 lines
334 B
Swift
18 lines
334 B
Swift
class ImmichPlugin: NSObject {
|
|
var detached: Bool
|
|
|
|
override init() {
|
|
detached = false
|
|
super.init()
|
|
}
|
|
|
|
func detachFromEngine() {
|
|
self.detached = true
|
|
}
|
|
|
|
func completeWhenActive<T>(for completion: @escaping (T) -> Void, with value: T) {
|
|
guard !self.detached else { return }
|
|
completion(value)
|
|
}
|
|
}
|