mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-29 20:48:40 +00:00
feat: remove after save
This commit is contained in:
committed by
bggRGjQaUbCoE
parent
f50965862d
commit
47ad1adfdc
@@ -34,7 +34,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
late final RxBool readOnly = false.obs;
|
||||
late final RxBool enablePublish = false.obs;
|
||||
|
||||
bool? hasPub;
|
||||
bool hasPub = false;
|
||||
void initPubState();
|
||||
|
||||
@override
|
||||
@@ -57,7 +57,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (hasPub != true) {
|
||||
if (!hasPub) {
|
||||
onSave();
|
||||
}
|
||||
focusNode.dispose();
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:PiliPlus/models_new/live/live_emote/emoticon.dart';
|
||||
import 'package:PiliPlus/models_new/upload_bfs/data.dart';
|
||||
import 'package:PiliPlus/pages/common/publish/common_publish_page.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_mention/view.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:dio/dio.dart' show CancelToken;
|
||||
@@ -58,6 +59,16 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (hasPub) {
|
||||
for (var i in pathList) {
|
||||
File(i).delSync();
|
||||
}
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
editController.richStyle = null;
|
||||
|
||||
@@ -25,7 +25,6 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart' hide TextField;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart' hide ContextExtensionss;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
class ReplyPage extends CommonRichTextPubPage {
|
||||
final int oid;
|
||||
@@ -377,9 +376,8 @@ class _ReplyPageState extends CommonRichTextPubPageState<ReplyPage> {
|
||||
.videoPlayerController
|
||||
?.screenshot(format: 'image/png');
|
||||
if (res != null) {
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
File file = File(
|
||||
'${tempDir.path}/${Utils.generateRandomString(8)}.png',
|
||||
final file = File(
|
||||
'${await Utils.temporaryDirectory}/${Utils.generateRandomString(8)}.png',
|
||||
);
|
||||
await file.writeAsBytes(res);
|
||||
pathList.add(file.path);
|
||||
|
||||
Reference in New Issue
Block a user