Skip to content

Commit 372614d

Browse files
authored
feat: add openAtLogin method to manage app startup behavior (#520)
* feat: add openAtLogin method to manage app startup behavior * Method for facade added
1 parent 60ac44a commit 372614d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/App.php

+13
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,17 @@ public function clearRecentDocuments(): void
6262
{
6363
$this->client->delete('app/recent-documents');
6464
}
65+
66+
public function openAtLogin(?bool $open = null): bool
67+
{
68+
if ($open === null) {
69+
return (bool) $this->client->get('app/open-at-login')->json('open');
70+
}
71+
72+
$this->client->post('app/open-at-login', [
73+
'open' => $open,
74+
]);
75+
76+
return $open;
77+
}
6578
}

src/Facades/App.php

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* @method static void addRecentDocument(string $path)
1515
* @method static array recentDocuments()
1616
* @method static void clearRecentDocuments()
17+
* @method static bool openAtLogin(?bool $open = null)
1718
*/
1819
class App extends Facade
1920
{

0 commit comments

Comments
 (0)