mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 09:45:14 +00:00
Merge branch 'krille/updatesdk' into 'main'
chore: Update SDK and add webworker support for web See merge request famedly/fluffychat!984
This commit is contained in:
commit
a24673beda
6 changed files with 33457 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -62,3 +62,4 @@ ios/Podfile.lock
|
|||
/linux/out
|
||||
/macos/out
|
||||
.vs
|
||||
assets/js/package/olm.js
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||
import 'package:matrix/matrix.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/utils/client_manager.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'settings_emotes_view.dart';
|
||||
|
||||
|
@ -206,10 +207,10 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
|||
);
|
||||
try {
|
||||
file = (await file.generateThumbnail(
|
||||
compute: Matrix.of(context).client.runInBackground,
|
||||
nativeImplementations: ClientManager.nativeImplementations,
|
||||
))!;
|
||||
} catch (_) {
|
||||
// do nothing
|
||||
} catch (e, s) {
|
||||
Logs().w('Unable to create thumbnail', e, s);
|
||||
}
|
||||
final uploadResp = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
|
|
|
@ -83,6 +83,10 @@ abstract class ClientManager {
|
|||
await Store().setItem(clientNamespace, jsonEncode(clientNamesList));
|
||||
}
|
||||
|
||||
static NativeImplementations get nativeImplementations => kIsWeb
|
||||
? NativeImplementationsWebWorker(Uri.parse('native_executor.js'))
|
||||
: NativeImplementationsIsolate(compute);
|
||||
|
||||
static Client createClient(String clientName) {
|
||||
return Client(
|
||||
clientName,
|
||||
|
@ -109,7 +113,7 @@ abstract class ClientManager {
|
|||
PlatformInfos.isMacOS)
|
||||
AuthenticationTypes.sso
|
||||
},
|
||||
compute: compute,
|
||||
nativeImplementations: nativeImplementations,
|
||||
customImageResizer: PlatformInfos.isMobile ? customImageResizer : null,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1063,7 +1063,7 @@ packages:
|
|||
name: matrix
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.11.0"
|
||||
version: "0.11.2"
|
||||
matrix_api_lite:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -61,7 +61,7 @@ dependencies:
|
|||
keyboard_shortcuts: ^0.1.4
|
||||
localstorage: ^4.0.0+1
|
||||
lottie: ^1.2.2
|
||||
matrix: ^0.11.0
|
||||
matrix: ^0.11.2
|
||||
matrix_homeserver_recommendations: ^0.3.0
|
||||
matrix_link_text: ^1.0.2
|
||||
native_imaging:
|
||||
|
|
33445
web/native_executor.js
Normal file
33445
web/native_executor.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue