mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
tweaks (#1780)
* opt: sized * fix: self send * feat: ctrl enter to send * opt: checked * opt: download notifier * opt: Future.syncValue * mod: account * mod: loading state * opt: DebounceStreamMixin * opt: report * opt: enum map * opt: file handler * opt: dyn color * opt: Uint8List subview * opt: FileExt * opt: computeLuminance * opt: isNullOrEmpty * opt: Get context * update [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt dynamicColor [skip ci] Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * fixes [skip ci] * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Signed-off-by: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
02e0d34127
commit
ce5e85e64b
@@ -15,7 +15,10 @@ class JsonFileHandler extends ReportHandler {
|
||||
final bool printLogs;
|
||||
final bool handleWhenRejected;
|
||||
|
||||
static late Future<RandomAccessFile> _future;
|
||||
static Future<RandomAccessFile> _future = LoggerUtils.getLogsPath()
|
||||
.then((file) => file.open(mode: FileMode.writeOnlyAppend))
|
||||
.then((raf) => raf.writeFrom(const []))
|
||||
.then(_flush);
|
||||
|
||||
JsonFileHandler._({
|
||||
this.enableDeviceParameters = true,
|
||||
@@ -35,12 +38,7 @@ class JsonFileHandler extends ReportHandler {
|
||||
bool handleWhenRejected = false,
|
||||
}) async {
|
||||
try {
|
||||
final raf = await (await LoggerUtils.getLogsPath()).open(
|
||||
mode: FileMode.writeOnlyAppend,
|
||||
);
|
||||
await raf.writeFrom(const []);
|
||||
await raf.flush();
|
||||
_future = Future.syncValue(raf);
|
||||
await _future;
|
||||
return JsonFileHandler._(
|
||||
enableDeviceParameters: enableDeviceParameters,
|
||||
enableApplicationParameters: enableApplicationParameters,
|
||||
@@ -55,10 +53,12 @@ class JsonFileHandler extends ReportHandler {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<RandomAccessFile> _flush(RandomAccessFile raf) => raf.flush();
|
||||
|
||||
static Future<RandomAccessFile> add(
|
||||
Future<RandomAccessFile> Function(RandomAccessFile) onValue,
|
||||
) {
|
||||
return _future = _future.then(onValue);
|
||||
return _future = _future.then(onValue).then(_flush);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user