File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,16 +243,16 @@ export const useChatStore = create((set, get) => {
243243 return { success : true , data : sentMessage } ;
244244 }
245245 } catch ( error ) {
246- let errorMessage = 'Failed to send message' ;
246+ let errorMessage = error ?. message || 'Failed to send message' ;
247247 if ( error ?. message ) {
248248 if ( error . message . includes ( 'KYBER' ) || error . message . includes ( 'Nuclear Key Reset' ) ) {
249249 errorMessage = 'Encryption failed due to incompatible key format. All participants must use the Nuclear Key Reset option in Settings.' ;
250250 } else if ( error . message . includes ( 'invalid encapsulation key' ) ) {
251251 errorMessage = 'Encryption failed due to key compatibility issues. Both participants need to reset their encryption keys.' ;
252252 } else if ( error . message . includes ( 'Failed to encrypt message for any participants' ) ) {
253253 errorMessage = 'Failed to encrypt message for any participants. Try using the Nuclear Key Reset option in Settings.' ;
254- } else if ( error . message . includes ( 'Users with incompatible keys detected ' ) ) {
255- errorMessage = error . message ;
254+ } else if ( error . message . includes ( 'No participant keys found ' ) ) {
255+ errorMessage = 'No encryption keys found for participants. Go to Settings and ensure your keys are set up, then ask your contact to do the same.' ;
256256 }
257257 }
258258 return { success : false , error : errorMessage } ;
You can’t perform that action at this time.
0 commit comments