mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Cleanup, fixes #3440
This commit is contained in:
parent
2066c36fef
commit
8f9d36bd3d
5 changed files with 1 additions and 30 deletions
|
@ -77,7 +77,6 @@ class InstallController extends Controller
|
||||||
{
|
{
|
||||||
abort_if(file_exists(base_path('.env')), 404, 'The .env configuration file already exists.');
|
abort_if(file_exists(base_path('.env')), 404, 'The .env configuration file already exists.');
|
||||||
return $this->checkPermissions($request);
|
return $this->checkPermissions($request);
|
||||||
return response()->json($request->all(), 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkPermissions($request)
|
protected function checkPermissions($request)
|
||||||
|
|
|
@ -44,7 +44,7 @@ class StoryService
|
||||||
return Cache::forget(self::STORY_KEY . 'by-id:id-' . $id);
|
return Cache::forget(self::STORY_KEY . 'by-id:id-' . $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStories($id, $pid)
|
public static function getStories($id, $pid = null)
|
||||||
{
|
{
|
||||||
return Story::whereProfileId($id)
|
return Story::whereProfileId($id)
|
||||||
->latest()
|
->latest()
|
||||||
|
|
|
@ -51,7 +51,6 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
||||||
],
|
],
|
||||||
'language' => null,
|
'language' => null,
|
||||||
'mentions' => StatusMentionService::get($status->id),
|
'mentions' => StatusMentionService::get($status->id),
|
||||||
'tags' => [],
|
|
||||||
'pf_type' => $status->type ?? $status->setType(),
|
'pf_type' => $status->type ?? $status->setType(),
|
||||||
'reply_count' => (int) $status->reply_count,
|
'reply_count' => (int) $status->reply_count,
|
||||||
'comments_disabled' => $status->comments_disabled ? true : false,
|
'comments_disabled' => $status->comments_disabled ? true : false,
|
||||||
|
|
|
@ -55,7 +55,6 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
'language' => null,
|
'language' => null,
|
||||||
'pinned' => null,
|
'pinned' => null,
|
||||||
'mentions' => StatusMentionService::get($status->id),
|
'mentions' => StatusMentionService::get($status->id),
|
||||||
'tags' => [],
|
|
||||||
'pf_type' => $status->type ?? $status->setType(),
|
'pf_type' => $status->type ?? $status->setType(),
|
||||||
'reply_count' => (int) $status->reply_count,
|
'reply_count' => (int) $status->reply_count,
|
||||||
'comments_disabled' => $status->comments_disabled ? true : false,
|
'comments_disabled' => $status->comments_disabled ? true : false,
|
||||||
|
|
|
@ -283,32 +283,6 @@
|
||||||
}, interval);
|
}, interval);
|
||||||
},
|
},
|
||||||
|
|
||||||
refreshNotifications() {
|
|
||||||
let self = this;
|
|
||||||
axios.get('/api/pixelfed/v1/notifications')
|
|
||||||
.then(res => {
|
|
||||||
let data = res.data.filter(n => {
|
|
||||||
if(n.type == 'share' || self.notificationMaxId >= n.id) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
if(data.length > 0) {
|
|
||||||
let ids = data.map(n => n.id);
|
|
||||||
let max = Math.max(ids);
|
|
||||||
if(max <= self.notificationMaxId) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
self.notificationMaxId = max;
|
|
||||||
self.notifications = data;
|
|
||||||
let beep = new Audio('/static/beep.mp3');
|
|
||||||
beep.volume = 0.7;
|
|
||||||
beep.play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchFollowRequests() {
|
fetchFollowRequests() {
|
||||||
if(window._sharedData.curUser.locked == true) {
|
if(window._sharedData.curUser.locked == true) {
|
||||||
axios.get('/account/follow-requests.json')
|
axios.get('/account/follow-requests.json')
|
||||||
|
|
Loading…
Reference in a new issue