feat(app): configure and safely switch multi-address servers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../../core/servers/server_scope.dart';
|
||||
|
||||
/// Whether a new chat starts with a prompt, and which, for one harness and
|
||||
/// directory: the last choice made there.
|
||||
@@ -13,10 +14,13 @@ abstract interface class ChatCreatePromptStore {
|
||||
}
|
||||
|
||||
class SharedPreferencesChatCreatePromptStore implements ChatCreatePromptStore {
|
||||
const SharedPreferencesChatCreatePromptStore();
|
||||
const SharedPreferencesChatCreatePromptStore({this.serverId = ''});
|
||||
final String serverId;
|
||||
|
||||
static String _key(String backend, String directory) =>
|
||||
'pipelines.chat.createPrompt.v1.$backend|$directory';
|
||||
String _key(String backend, String directory) => scopedServerKey(
|
||||
'pipelines.chat.createPrompt.v1.$backend|$directory',
|
||||
serverId,
|
||||
);
|
||||
|
||||
@override
|
||||
Future<ChatCreatePrompt?> read(String backend, String directory) async {
|
||||
|
||||
Reference in New Issue
Block a user