diff --git a/lib/pages/new_space/new_space_view.dart b/lib/pages/new_space/new_space_view.dart index 469a3326d..f8c7baf4e 100644 --- a/lib/pages/new_space/new_space_view.dart +++ b/lib/pages/new_space/new_space_view.dart @@ -124,26 +124,35 @@ class NewSpaceView extends StatelessWidget { startOpen: true, spaceMode: true, ), - FutureBuilder( - future: Matrix.of(context).client.lastUpdatedRoomRules, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done) { - return RoomRulesEditor( - key: controller.rulesEditorKey, - roomId: null, - startOpen: false, - initialRules: snapshot.data, - ); - } else { - return const Padding( - padding: EdgeInsets.all(16.0), - child: Center( - child: CircularProgressIndicator.adaptive(strokeWidth: 2), - ), - ); - } - }, - ), + if (controller.rulesEditorKey.currentState != null) + RoomRulesEditor( + key: controller.rulesEditorKey, + roomId: null, + startOpen: false, + initialRules: controller.rulesEditorKey.currentState!.rules, + ), + if (controller.rulesEditorKey.currentState == null) + FutureBuilder( + future: Matrix.of(context).client.lastUpdatedRoomRules, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return RoomRulesEditor( + key: controller.rulesEditorKey, + roomId: null, + startOpen: false, + initialRules: snapshot.data, + ); + } else { + return const Padding( + padding: EdgeInsets.all(16.0), + child: Center( + child: + CircularProgressIndicator.adaptive(strokeWidth: 2), + ), + ); + } + }, + ), // SwitchListTile.adaptive( // title: Text(L10n.of(context)!.spaceIsPublic), // value: controller.publicGroup,