upsert container when cloning
This commit is contained in:
@@ -127,8 +127,10 @@ class TabRepository extends _$TabRepository {
|
||||
.toSet();
|
||||
|
||||
// Batch validate parent IDs that aren't in the current creation batch
|
||||
final existingParentIds =
|
||||
await tabDao.getExistingTabIds(parentIdsToValidate).get().then((ids) => ids.toSet());
|
||||
final existingParentIds = await tabDao
|
||||
.getExistingTabIds(parentIdsToValidate)
|
||||
.get()
|
||||
.then((ids) => ids.toSet());
|
||||
|
||||
// Upsert all tabs in the database
|
||||
for (var i = 0; i < createdTabIds.length; i++) {
|
||||
@@ -160,17 +162,11 @@ class TabRepository extends _$TabRepository {
|
||||
|
||||
Future<String> duplicateTab({
|
||||
required String selectTabId,
|
||||
required String? containerId,
|
||||
required ContainerData? containerData,
|
||||
required bool selectTab,
|
||||
}) async {
|
||||
final tabDao = ref.read(tabDatabaseProvider).tabDao;
|
||||
|
||||
final containerData = await containerId.mapNotNull(
|
||||
(containerId) => ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.getContainerData(containerId),
|
||||
);
|
||||
|
||||
return await tabDao.upsertTabTransactional(
|
||||
() {
|
||||
return _tabsService.duplicateTab(
|
||||
|
||||
@@ -41,7 +41,7 @@ final class TabRepositoryProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$tabRepositoryHash() => r'6a66c2f1f8d00767d19e6125d4eafc6d93381c8a';
|
||||
String _$tabRepositoryHash() => r'ab4ba2bf11ccbd99497819b9068cbbd733a93d81';
|
||||
|
||||
abstract class _$TabRepository extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
Reference in New Issue
Block a user