@@ -105,7 +105,7 @@ struct CopilotView: View {
105105 do {
106106 try await viewModel. install ( )
107107 } catch {
108- toast ( Text ( error. localizedDescription) , . error)
108+ toast ( error. localizedDescription, . error)
109109 }
110110 }
111111 } ) {
@@ -120,7 +120,7 @@ struct CopilotView: View {
120120 do {
121121 try await viewModel. install ( )
122122 } catch {
123- toast ( Text ( error. localizedDescription) , . error)
123+ toast ( error. localizedDescription, . error)
124124 }
125125 }
126126 } ) {
@@ -270,13 +270,13 @@ struct CopilotView: View {
270270 if let step = newValue {
271271 switch step {
272272 case . downloading:
273- toast ( Text ( " Downloading.. " ) , . info)
273+ toast ( " Downloading.. " , . info)
274274 case . uninstalling:
275- toast ( Text ( " Uninstalling old version.. " ) , . info)
275+ toast ( " Uninstalling old version.. " , . info)
276276 case . decompressing:
277- toast ( Text ( " Decompressing.. " ) , . info)
277+ toast ( " Decompressing.. " , . info)
278278 case . done:
279- toast ( Text ( " Done! " ) , . info)
279+ toast ( " Done! " , . info)
280280 checkStatus ( )
281281 }
282282 }
@@ -295,14 +295,13 @@ struct CopilotView: View {
295295
296296 if status != . ok, status != . notSignedIn {
297297 toast (
298- Text (
299- " GitHub Copilot status is not \" ok \" . Please check if you have a valid GitHub Copilot subscription. "
300- ) ,
298+ " GitHub Copilot status is not \" ok \" . Please check if you have a valid GitHub Copilot subscription. " ,
299+
301300 . error
302301 )
303302 }
304303 } catch {
305- toast ( Text ( error. localizedDescription) , . error)
304+ toast ( error. localizedDescription, . error)
306305 }
307306 }
308307 }
@@ -316,17 +315,17 @@ struct CopilotView: View {
316315 let ( uri, userCode) = try await service. signInInitiate ( )
317316 self . userCode = userCode
318317 guard let url = URL ( string: uri) else {
319- toast ( Text ( " Verification URI is incorrect. " ) , . error)
318+ toast ( " Verification URI is incorrect. " , . error)
320319 return
321320 }
322321 let pasteboard = NSPasteboard . general
323322 pasteboard. declareTypes ( [ NSPasteboard . PasteboardType. string] , owner: nil )
324323 pasteboard. setString ( userCode, forType: NSPasteboard . PasteboardType. string)
325- toast ( Text ( " Usercode \( userCode) already copied! " ) , . info)
324+ toast ( " Usercode \( userCode) already copied! " , . info)
326325 openURL ( url)
327326 isUserCodeCopiedAlertPresented = true
328327 } catch {
329- toast ( Text ( error. localizedDescription) , . error)
328+ toast ( error. localizedDescription, . error)
330329 }
331330 }
332331 }
@@ -338,14 +337,14 @@ struct CopilotView: View {
338337 do {
339338 let service = try getGitHubCopilotAuthService ( )
340339 guard let userCode else {
341- toast ( Text ( " Usercode is empty. " ) , . error)
340+ toast ( " Usercode is empty. " , . error)
342341 return
343342 }
344343 let ( username, status) = try await service. signInConfirm ( userCode: userCode)
345344 self . settings. username = username
346345 self . status = status
347346 } catch {
348- toast ( Text ( error. localizedDescription) , . error)
347+ toast ( error. localizedDescription, . error)
349348 }
350349 }
351350 }
@@ -358,7 +357,7 @@ struct CopilotView: View {
358357 let service = try getGitHubCopilotAuthService ( )
359358 status = try await service. signOut ( )
360359 } catch {
361- toast ( Text ( error. localizedDescription) , . error)
360+ toast ( error. localizedDescription, . error)
362361 }
363362 }
364363 }
0 commit comments