This commit is contained in:
Thomas 2022-10-07 11:27:28 +02:00
parent 95e83305e4
commit 9885aa2235
3 changed files with 5 additions and 1 deletions

View File

@ -824,6 +824,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
.addTag(Helper.WORKER_SCHEDULED_STATUSES)
.setInitialDelay(delayToPass, TimeUnit.MILLISECONDS)
.build();
WorkManager.getInstance(ComposeActivity.this).enqueue(oneTimeWorkRequest);
statusDraft.workerUuid = oneTimeWorkRequest.getId();
statusDraft.scheduled_at = date;
Handler mainHandler = new Handler(Looper.getMainLooper());

View File

@ -37,6 +37,7 @@ import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.work.Data;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
import com.bumptech.glide.Glide;
import com.google.gson.annotations.SerializedName;
@ -389,6 +390,7 @@ public class MastodonHelper {
.setInputData(inputData)
.setInitialDelay(delayToPass, TimeUnit.MILLISECONDS)
.build();
WorkManager.getInstance(context).enqueue(oneTimeWorkRequest);
ScheduledBoost scheduledBoost = new ScheduledBoost();
scheduledBoost.userId = BaseMainActivity.currentUserID;
scheduledBoost.statusId = status.reblog != null ? status.reblog.id : status.id;

View File

@ -110,9 +110,10 @@ public class PushHelper {
}).start();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String value = prefs.getString(context.getString(R.string.SET_NOTIFICATION_DELAY_VALUE), "15");
new PeriodicWorkRequest.Builder(NotificationsWorker.class, Long.parseLong(value), TimeUnit.MINUTES)
PeriodicWorkRequest notificationPeriodic = new PeriodicWorkRequest.Builder(NotificationsWorker.class, Long.parseLong(value), TimeUnit.MINUTES)
.addTag(Helper.WORKER_REFRESH_NOTIFICATION)
.build();
WorkManager.getInstance(context).enqueue(notificationPeriodic);
}