mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-04 15:19:48 +00:00
Cleanup.
This commit is contained in:
parent
9075a2599c
commit
e45c8617df
1 changed files with 3 additions and 4 deletions
|
@ -62,20 +62,19 @@ class StatePolycentric {
|
||||||
|
|
||||||
val activeProcessHandleString = _activeProcessHandle.value;
|
val activeProcessHandleString = _activeProcessHandle.value;
|
||||||
if (activeProcessHandleString.isNotEmpty()) {
|
if (activeProcessHandleString.isNotEmpty()) {
|
||||||
val system =
|
val system = PublicKey.fromProto(Protocol.PublicKey.parseFrom(activeProcessHandleString.base64ToByteArray()));
|
||||||
PublicKey.fromProto(Protocol.PublicKey.parseFrom(activeProcessHandleString.base64ToByteArray()));
|
|
||||||
setProcessHandle(Store.instance.getProcessSecret(system)?.toProcessHandle());
|
setProcessHandle(Store.instance.getProcessSecret(system)?.toProcessHandle());
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
_transientEnabled = false
|
_transientEnabled = false
|
||||||
UIDialogs.toast(context, "Polycentric failed to initialize.")
|
UIDialogs.toast(context, "Polycentric failed to initialize due to an error.")
|
||||||
Log.i(TAG, "Failed to initialize Polycentric.", e)
|
Log.i(TAG, "Failed to initialize Polycentric.", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ensureEnabled() {
|
fun ensureEnabled() {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
throw Exception("Cannot set process handle when Polycentric is disdabled")
|
throw Exception("Polycentric is disabled")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue