Enhance EditorSession state to include token in active and read-only states; update editor handler to use new Collabora URL
This commit is contained in:
@@ -52,9 +52,9 @@ class EditorSessionBloc extends Bloc<EditorSessionEvent, EditorSessionState> {
|
||||
return;
|
||||
}
|
||||
if (!session.readOnly) {
|
||||
emit(EditorSessionActive(editUrl: session.editUrl));
|
||||
emit(EditorSessionActive(editUrl: session.editUrl, token: session.token));
|
||||
} else {
|
||||
emit(EditorSessionReadOnly(viewUrl: session.editUrl));
|
||||
emit(EditorSessionReadOnly(viewUrl: session.editUrl, token: session.token));
|
||||
}
|
||||
_expiryTimer = Timer(
|
||||
session.expiresAt.difference(DateTime.now()),
|
||||
|
||||
@@ -13,20 +13,22 @@ class EditorSessionStarting extends EditorSessionState {}
|
||||
|
||||
class EditorSessionActive extends EditorSessionState {
|
||||
final Uri editUrl;
|
||||
final String token;
|
||||
|
||||
const EditorSessionActive({required this.editUrl});
|
||||
const EditorSessionActive({required this.editUrl, required this.token});
|
||||
|
||||
@override
|
||||
List<Object> get props => [editUrl];
|
||||
List<Object> get props => [editUrl, token];
|
||||
}
|
||||
|
||||
class EditorSessionReadOnly extends EditorSessionState {
|
||||
final Uri viewUrl;
|
||||
final String token;
|
||||
|
||||
const EditorSessionReadOnly({required this.viewUrl});
|
||||
const EditorSessionReadOnly({required this.viewUrl, required this.token});
|
||||
|
||||
@override
|
||||
List<Object> get props => [viewUrl];
|
||||
List<Object> get props => [viewUrl, token];
|
||||
}
|
||||
|
||||
class EditorSessionFailed extends EditorSessionState {
|
||||
|
||||
Reference in New Issue
Block a user