Skip to content

Commit

Permalink
Add feedback message to user for sync videos
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedHelalAhmed committed Sep 4, 2021
1 parent 9d5e730 commit 1d78c6f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/SyncVideosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class SyncVideosController
public function __invoke(Channel $channel)
{
dispatch(new SyncVideosForGivenChannelJob($channel));
return back();
return back()->with('message', 'Sync under processing please wait some minutes and try to refresh the page again. . .');
}
}
6 changes: 5 additions & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public function version(Request $request)
public function share(Request $request)
{
return array_merge(parent::share($request), [
//
'flash' => [
'message' => function()use($request){
return $request->session()->get('message');
}
],
]);
}
}
2 changes: 1 addition & 1 deletion public/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/app.js": "/js/app.js?id=4c465d3b6a260335f189",
"/css/app.css": "/css/app.css?id=6cc2e88e64301f36a09f"
"/js/app.js": "/js/app.js?id=1b7720fdb6a840b2f98b",
"/css/app.css": "/css/app.css?id=496d7e001b40cf77901a"
}
10 changes: 5 additions & 5 deletions resources/js/Pages/Channels/Videos/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@
</form>
</div>
</template>

<div class="py-12">

<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
<div class="text-center p-6 border-gray-200">

<div v-if="$page.props.flash.message" class="text-blue-400 text-4xl mb-3">
{{ $page.props.flash.message }}
</div>
<div v-if="!videos.data.length">No videos to show</div>
<div
v-for="video in videos.data"
:key="video.id"
Expand Down Expand Up @@ -181,7 +184,6 @@ export default defineComponent({
});
function filter() {
console.log(form);
// form.page=this.videos.current_page;
Inertia.get(route('channels.show', this.channel.id), form);
}
Expand All @@ -196,7 +198,6 @@ export default defineComponent({
form.is_seen = null;
form.is_favorite = null;
form.title = null;
console.log(form);
}
return {submit, filter, form, params, resetForm};
Expand Down Expand Up @@ -228,7 +229,6 @@ export default defineComponent({
let parameterValidCount = 0;
for (let parameterName in this.params) {
if (this.params[parameterName] && parameterName != 'channel') {
console.log(this.params[parameterName]);
++parameterValidCount;
}
}
Expand Down

0 comments on commit 1d78c6f

Please sign in to comment.